Worked Examples

Developer reference for ethical participation — Catalyst Grit

Build and troubleshoot ethical-participation workflows in Catalyst Grit with source-reviewed engineering guidance, executable Python, and security-negative tests. This developer reference covers consent provenance, project-scoped permissions, withdrawal, data retention, idempotency, audit integrity, and independent publication approval without treating software checks as scientific or regulatory certification.

ProductCatalyst GritComponentEthical Participation, Research GovernanceUpdatedDecember 2, 2026Reading time37 minutes

Application: Catalyst Grit
Article type: Developer reference — ethical participation
Status: Candidate integration contract; installed controls not certified
Last source-reviewed version: v2.0.0, pinned to commit f9617160ffd276c6a6fd847b1e846bb5f73b07ae
Last verified version: Not established — installed release unverified
Estimated reading time: 30–40 minutes

Header summary: Build and troubleshoot ethical-participation workflows in Catalyst Grit with source-reviewed engineering guidance, executable Python and security-negative tests. This developer reference covers consent provenance, project-scoped permissions, withdrawal, data retention, idempotency, audit integrity, and independent publication approval without treating software checks as scientific or regulatory certification.

Goal

Implement and independently verify an ethical-participation workflow for sensitive human-systems research: collect only within a documented purpose and authorized basis, preserve participant choice, restrict disclosure, honor withdrawal decisions, and require a separate human publication review. The developer’s deliverable is a testable, auditable contract—not an automated judgment about a participant.

Acceptance condition: collection, access, withdrawal, retention, export and publication decisions are justified by the applicable approved protocol and tested against negative cases. Software correctness cannot independently prove meaningful consent, voluntariness, scientific validity or legal compliance.

Requirements

  • Environment: Python 3.10+ and the packaged standard-library adapter; local fictional records only. No network services, real participant data, credentials or third-party packages are needed.
  • Research governance: approved purpose, designated accountable owner, participant information version, documented consent or authorized alternative, withdrawal and retention policy. Actual jurisdiction and IRB/ethics requirements require separate institutional review.
  • Engineering: canonical participant/event/revision identifiers, tenant and project scopes, consent provenance, allowed fields, immutable hashes, idempotency, optimistic concurrency, audit events, private visibility and publication redaction.
  • Validation: permitted role and project, least-privilege actions, record timing relative to authorization and withdrawal, duplicate rejection, export restrictions, rollback, and human review.
  • Release evidence: actual installed build version, reviewed GitHub commit, verified UI/API behavior, staging test record and approved deployment—none of which is provided by the local fixture alone.

Source-reviewed architecture versus proposed controls

At the reviewed commit f9617160ffd276c6a6fd847b1e846bb5f73b07ae, Catalyst Grit documents a private SQLite workspace, append-only revisions, controlled purge, an authenticated WordPress private workspace, and an institutional API with scoped bearer tokens and project allowlists. Its openapi.yaml describes a read-only GET /v1/projects/{project_id}/records route with a records:read scope, as well as a governed publication route. The review does not establish a dedicated deployed consent-management endpoint, waiver-approval route or the JSON schema below.

Reviewed source: Release-described README; OpenAPI contract; SQLite persistence source; Institutional API specifications.

Status vocabulary: source-reviewed = verified in a pinned repository artifact; proposed = defined and locally tested here; staging-verified = pending; production-verified = pending.

Reference data model and field ownership

The package includes fixtures/fictional_developer_request.json and schemas/candidate_ethical_participation.schema.json. These are fictional teaching contracts, not deployed Catalyst Grit models. Different entities have different authority:

Entity Minimum proposed fields Trust boundary
Protocol ID, approved purpose, version, tenant/project, permitted fields, retention/withdrawal rule Approved by governance, never self-asserted by a participant event
Consent or waiver Basis, status, version, recorded timestamp, purpose, approved waiver evidence Externally approved authority; a UI checkbox is not a waiver
Actor Authenticated identity, role, scopes, tenant and project Enforced on server, not trusted from request JSON
Observation event Event ID, purpose, timestamp, field allowlist, source hash, revision, idempotency key Private, restricted research data
Audit and review Append success, immutable event reference, reviewer, status and reasons Must not contain the raw participant narrative or secrets
Withdrawal/retention Request timestamp, collection cutoff, prior-data disposition, legal holds Authorized steward interprets protocol and applicable law
Publication Independent approval, redaction review and safe destination Separate from record-save and project write permission

Reference request and response contract

{
  "operation": "collect",
  "actor": {"role": "researcher", "project_id": "FICTIONAL-PROJECT", "tenant_id": "FICTIONAL-TENANT", "scopes": ["records:write"]},
  "event": {"id": "FICTIONAL-EVT-01", "revision_id": "FICTIONAL-REV-02", "expected_revision": "FICTIONAL-REV-01", "idempotency_key": "FICTIONAL-IDEMPOTENCY-01", "visibility": "private"},
  "response": {"accepted": true, "errors": [], "reference_only": true}
}

This excerpt summarizes selected fields; the complete valid JSON fixture also contains the protocol, consent state, source hash, timestamps, audit state and review decisions. The local adapter returns named reference errors, not actual deployed HTTP status codes.

Consent, purpose and authorization state transitions

Require an explicit source and reviewer for any consent/authorization change. Proposed states include active, declined and withdrawn, while a documented waiver has its own authorized basis. A consent grant for research cannot be reused for marketing or another purpose; obtain a new valid authority before collecting or transferring data for a changed purpose.

For a collection request, verify the authoritative server-side context and the participant authorization effective at the event time. A delayed upload or offline queue must not bypass a later withdrawal. Reject missing consent documentation or an unapproved waiver. Test accessibility, comprehension and undue influence independently with qualified human oversight: no programmatic flag certifies them.

Procedure

  1. Identify the operation: collect, export, publish, withdraw, purge or handoff, and locate the actual installed code path before making integration claims.
  2. Bind context server-side: obtain identity, tenant, project and scopes from trusted session/token validation; do not accept client-declared authorization as proof.
  3. Read protocol and consent: verify approved purpose, information version, consent or waiver basis, current status, and effective timestamps; consult owner when unclear.
  4. Validate the event: reject unapproved fields, invalid chronology, public visibility, missing event ID/hash, reused event ID or conflicting idempotency key.
  5. Check concurrency: compare expected and current revision before write; record a new append-only revision and audit event only when authorized.
  6. Enforce privacy: minimize data, sanitize logs, constrain export, index and cross-product handoffs; require independent review for publication.
  7. Handle withdrawal: record request, stop new collection at the appropriate time, reconcile queued events and obtain explicit prior-data disposition. Do not automatically purge historical data.
  8. Verify: execute synthetic negative tests, confirm controlled rejection and immutable audit events, stage with approved fixtures, review by research governance, then document installed-release verification.

Terminal setup and repeatable local audit

# From the extracted package root
python3 --version
python3 code/developer_ethical_participation.py contract
python3 code/developer_ethical_participation.py manifest
python3 code/scientific_ethical_participation.py denominators
python3 -m unittest discover -s tests -v

Expected: the clean contract command returns "accepted": true, "errors": [] and "installed_release_verified": false. The inherited research fixture includes 12 fictional invitations, 10 initially consenting, two declining and two later withdrawing; it does not demonstrate real research behavior or evidence of voluntary consent.

Python implementation: inspection and field checks

# Selected code from the packaged developer_ethical_participation.py
from developer_ethical_participation import make_fixture, validate_request

request = make_fixture()  # wholly fictional
errors = validate_request(request, operation="collect")
if errors:
    raise ValueError({"reference_contract_errors": errors})
# No data are written and no deployed service is called.

The full adapter checks the request’s research authorization, privacy scope, permitted field list, consent timing, optimistic revision, source SHA-256, idempotency key, audit completeness and review state. It is intentionally conservative and has no database, network access or privilege-enforcement service.

Negative cases and expected error codes

python3 code/developer_ethical_participation.py inject --case no_consent
python3 code/developer_ethical_participation.py inject --case consent_expired
python3 code/developer_ethical_participation.py inject --case wrong_tenant
python3 code/developer_ethical_participation.py inject --case missing_scope
python3 code/developer_ethical_participation.py inject --case duplicate_event
python3 code/developer_ethical_participation.py inject --case idempotency_conflict
python3 code/developer_ethical_participation.py inject --case stale_revision
python3 code/developer_ethical_participation.py inject --case audit_unavailable
python3 code/developer_ethical_participation.py inject --case export_raw
python3 code/developer_ethical_participation.py inject --case publish_unreviewed
python3 code/developer_ethical_participation.py inject --case withdraw_continues
python3 code/developer_ethical_participation.py inject --case purge_legal_hold

Every injection checks a named expected code, not just a generic error. A detected fault returns process exit code 0; a missed fault returns nonzero. docs/DEVELOPER_FAULT_RESULTS.json records all 44 named cases and outcomes.

Read-only source-documented API smoke test

# ONLY with an explicitly approved staging base and valid staging credentials.
# This route is documented in the pinned openapi.yaml; installation is unverified.
export GRIT_STAGING_BASE="https://approved-staging.example"
export GRIT_STAGING_PROJECT="approved-fixture-project"
read -rsp "Staging bearer token: " GRIT_STAGING_TOKEN; echo
curl -sS -o /dev/null -w 'HTTP %{http_code}\n' \
  -H "Authorization: Bearer ${GRIT_STAGING_TOKEN}" \
  "${GRIT_STAGING_BASE}/v1/projects/${GRIT_STAGING_PROJECT}/records"
unset GRIT_STAGING_TOKEN

Do not execute against production or a real participant project as a casual test. Suppress response bodies to avoid leaking private data. Network success alone is not proof of isolation, consent governance or endpoint suitability. The local package needs no token and makes no network call.

Idempotency, concurrency and audit guarantees

Use the same idempotency key only for the same logical request and canonical payload. A changed payload under the same key is a conflict, not a second event. A distinct event ID must not point to another participant’s or project’s event. Before mutation, compare expected revision with the authoritative current revision; never overwrite earlier consent or participant evidence. If the audit append fails, reject the protected operation and preserve a minimal nonsecret diagnostic. The reference adapter tests IDEMPOTENCY_CONFLICT, REVISION_CONFLICT and AUDIT_UNAVAILABLE; real transactional behavior requires staging tests.

Withdrawals, retention and privacy deletion

Withdrawal means the future collection and interaction scope must be reassessed promptly, including queued and offline events. Already collected data may be retained for certain research purposes under an approved protocol and applicable law, rather than automatically deleted; participants should be told what withdrawal means. The example requires prior_data_disposition but does not decide the lawful outcome. HHS OHRP’s withdrawal guidance describes this distinction for research under 45 CFR part 46.

Separately test that a purge is steward-authorized and that legal holds block destructive action. The reviewed Catalyst Grit private workspace documents delete_record, set_retention and purge_record(confirm=True); those are source-reviewed repository operations and not evidence that the proposed consent workflow invokes them automatically.

Publication, redaction and scientific interpretation

Record-save success must never imply institutional approval, publication readiness, permitted public indexing or scientific accuracy. Distinguish a publication write scope from a reviewer decision and a separate redaction decision. Export or cross-product use requires purpose and recipient authorization plus provenance preservation. Avoid disclosing rare-group information or pseudonymous records that can be reidentified. A public aggregate may still carry disclosure risk.

Consent metadata alone cannot show participants understood study risks, were free from coercion or received equitable recruitment. Nor can it establish the validity of an instrument, a clinical diagnosis, or causal benefit. Independently review psychological claims and participant protections under the applicable oversight framework.

Troubleshooting

Symptom Local diagnostic Investigation
Consent record absent or out of date --case no_consent / consent_outdated Stop collection; verify approved information/version or waiver
Request reads another tenant/project wrong_tenant / wrong_project Examine server-trusted identity and project scoping
Conflicting retries produce duplicate events idempotency_conflict / duplicate_event Reconcile canonical IDs and content hashes
Stale revision accepted stale_revision Review optimistic lock, append-only history, conflicting edits
Research content enters public export export_raw / publish_identifiers Disable exposure and review audit/notification obligations
Data collection continues after withdrawal withdraw_continues Quarantine queued writes and honor new collection cutoff
Data is purged despite hold purge_legal_hold Stop deletion; obtain approved legal/retention decision
Validation passes but ethical concerns remain claimed_comprehension Independent IRB/ethics or human research-process review required

Resolution

  1. Contain: stop unsafe collection/export/publication or destructive operations; prevent further participant exposure.
  2. Preserve: capture nonsecret request ID, project, actor role, revision, hash, consent/protocol version, timestamp and error classification. Do not paste sensitive narratives or tokens into public tickets.
  3. Reproduce: build a minimal synthetic fixture and run the matching injected fault. Confirm the actual installed route before linking a local error to production.
  4. Correct: repair identity scope, effective consent, field restrictions, idempotency, concurrency or review gate in approved staging; preserve historical evidence and use authorized corrective revisions.
  5. Reconcile: handle withdrawal and past-data disposition under the governing protocol; do not infer deletion or waive required record retention.
  6. Verify: rerun local and staging negative tests, obtain independent security/research approval and document the installed build, evidence and rollback results.

Verification

Local acceptance: all inherited scientific/operating tests and new developer tests pass; every named fault produces its expected code; source hashes validate; only fictional records are used; privacy and scope decisions fail closed. Staging acceptance: separately verify token scopes, project isolation, consent/waiver controls where actually implemented, withdrawal races, append-only audit, backups, retention, redaction and publication gates. Research acceptance: applicable IRB/ethics and privacy stakeholders review the actual protocol and conduct. These are different gates.

Run python3 -m unittest discover -s tests -v. Review docs/TEST_RESULTS.txt and docs/STAGING_ACCEPTANCE.md. No staging item is marked complete in this package.

Repository evidence and release references

These paths were reviewed at commit f9617160ffd276c6a6fd847b1e846bb5f73b07ae. The repository describes v2.0.0, but the last installed version verified remains not established. Do not invent a GitHub issue or official Release page. The README is a source-reviewed release description—not proof of production deployment.

Research ethics references and limitations

See HHS Belmont Report (respect, beneficence, justice); HHS OHRP Informed Consent FAQs; OHRP withdrawal guidance; and OHRP electronic consent guidance.

Limits: no real authorization/withdrawal process was tested, no independent research review completed, no installed release verified, and no claim about jurisdiction-specific compliance or clinical/psychometric validity is made. A research ethics officer and authorized owner must establish governing requirements.

Editorial fields: Last source-reviewed version: v2.0.0; last verified version: not established; article type: developer reference; status: verification pending. The live WordPress KB integrity checker may require a separate version metadata field even when the body includes this statement.

Related product intelligence

Releases and known issues

Related releases

  • v2.0.0
Scroll to Top