Worked Examples
Developer reference for intervention tracking — Catalyst Grit
Develop and validate intervention-tracking workflows in Catalyst Grit using real longitudinal psychological research observations, reproducible Python, and source-reviewed engineering guidance. This developer reference covers intervention assignment, delivery and receipt, event timing, implementation fidelity, psychometric measurement safeguards, missing-data analysis, versioned data contracts, privacy controls, security-negative tests, and human-reviewed publication requirements.
Application: Catalyst Grit
Article type: Developer reference / intervention research
Last source-reviewed version: v2.0.0 (f9617160ffd276c6a6fd847b1e846bb5f73b07ae)
Last verified version: Not verified — installed-release evidence unavailable
Editorial status: Verification pending
Estimated reading time: 28–38 minutes
1. Goal
Provide an implementable, source-reviewed reference contract for tracking psychological interventions and environmental changes over time without confusing assignment, delivery, participant receipt, fidelity, measurement, or outcome. Engineers must preserve time ordering, provenance, authorization, and human review; researchers must preserve the trial estimand, instrument validity, missingness assumptions, and competing explanations.
Acceptance criterion: Every claim about an intervention and a measured outcome discloses its source, intervention timing, exposure verification status, assessment window, missing follow-up denominators, plausible alternative explanations, uncertainty, and reviewer decision.
2. Requirements
Application: Catalyst Grit. Last source-reviewed version: v2.0.0, Git commit f9617160ffd276c6a6fd847b1e846bb5f73b07ae. Last verified version: Not verified; the installed production release and operational controls have not been checked. Documentation status: Source-reviewed guidance, independent scientific and staging validation pending.
- Authorized project-level research purpose, consent or lawful basis, approved data-management and ethics procedures.
- Explicit trial or program definitions, target population, intervention protocol and timing windows, exposure and outcome units, instrument editions, schedule, retention rules.
- Python 3 for bundled offline test commands. Optional dependencies and repository tests are separate from the package’s standard-library scripts.
- Immutable source fixture, synthetic event fixtures, a defined reviewer, a security owner, and a prespecified estimand for scientific analysis.
No exact WordPress control, server route, or deployed intervention-event data model is asserted without installed-version inspection.
3. Source-reviewed system boundaries
The v2.0.0 repository overview identifies a private twelve-stage connected recovery and learning platform. The connected-platform specification preserves source artifacts, hashes, human-review requirements and cross-product connection states. The monitoring-trends specification describes immutable monitoring snapshots tied to record revision, engine version and methodology. These facts support building an auditable adapter but do not establish that the installed application provides a clinical treatment delivery registry, BDI-II instrument integration, session logging or a causal inference engine.
These integration requirements are proposed. The included Python scripts are independent reproducible tools, not registered Catalyst Grit commands or API endpoints. The platform expressly prohibits clinical diagnosis, character scoring, individual ranking and automated eligibility decisions.
4. Research fixture and data interpretation
Use the HSAUR Beat the Blues dataset documentation and the published Rdatasets BtheB CSV as provenance references. The local 100-row copy contains randomized assignment to computerized cognitive behavioral therapy (BtheB) or treatment as usual (TAU), with repeated BDI-II scores at baseline and two, four, six, and eight months.
| Arm | Assigned | Eight-month score observed | Eight-month score missing |
|---|---|---|---|
| Beat the Blues | 52 | 27 | 25 |
| Treatment as usual | 48 | 25 | 23 |
At eight months, 48 of 100 randomized participants lack recorded outcomes. This extract documents assignment and outcome scores, not actual treatment sessions, adherence, fidelity or verified receipt. The JSON intervention events in this package are wholly synthetic and do not correspond to the real trial participants; they must not be joined to them.
BDI-II has a score range of 0–63, but the local extract has aggregate scores rather than item responses. It cannot establish item-level reliability, measurement invariance, instrument licensing compliance or clinical interpretation. Independently verify transcription against the upstream dataset before publishing a scientific analysis.
5. Proposed canonical event contract
Model intervention assignments, plans, deliveries, participant receipt, modifications, discontinuations, environmental exposures and outcomes as distinct artifact types with a transparent link policy.
| Contract field | Example / role | Required invariant |
|---|---|---|
| event_id / idempotency_key | Synthetic unique event + request key | No duplicate event or replay side effects |
| project_id / actor_project / actor_id | Authorization and audit lineage | Project scope must match; identity must be verified in staging |
| intervention_id / event_kind | Type and intervention reference | Known controlled vocabulary |
| planned_at / occurred_at | ISO-8601 timestamps with timezone | Ordered, unambiguous event chronology |
| source_ref / source_hash | Provenance and evidence digest | Source must be versioned and accessible only to authorized actors |
| expected_revision / actual_revision | Optimistic concurrency | Reject stale revision writes |
| evidence_verified / review_state | Receipt evidence and publication state | Delivery claims require supporting evidence; save never implies approval |
| instrument_version / analysis_version | Outcome and methodology versions | Cross-wave comparisons require independent psychometric review |
| visibility / retention_policy | Privacy boundaries | Private by default; controlled export and deletion processes |
| competing_explanations_documented | Alternative treatments/environment | Do not present uncontrolled association as causal |
This contract is a proposed integration adapter. The named JSON fields and validator diagnostic codes are not claims about existing server schemas.
6. Procedure
- Confirm research authorization. Specify study, project, actor permissions, protocol version, privacy classification and allowed analysis.
- Identify what was assigned. Retain the assignment timestamp and assignment mechanism separately from later events.
- Define intervention event semantics. Distinguish scheduled, delivered, attended, changed, paused and discontinued; separately log environmental or concurrent treatments with documented source.
- Capture timestamped evidence. Record a canonical event identifier, source digest, immutable original revision, actor, timezone, planned and actual dates, evidence verification and reason for correction.
- Validate contract and idempotency. Reject replayed keys, cross-project access, stale revisions, contradictory event order and unsupported claims before accepting a write.
- Preserve the outcome schedule. Record assessment windows, instrument version, scoring definitions, missing visits, all eligible denominators and review status without substituting a score for missing response.
- Assess competing explanations. Log concurrent care, environmental factors, timing deviations, selection bias, missing follow-up and study limitations.
- Run statistical and psychometric review. Document estimand and population, distinguish descriptive from causal claims, review measurement comparability, and use sensitivity analysis for missingness.
- Enforce human governance. Verify audit events, private visibility, redacted exports and independent publication approval. Retain failed-case evidence and staging sign-off.
7. Terminal: reproducible environment
# Run in extracted package directory (Python 3, standard library)
python3 --version
python3 code/developer_intervention_tracking.py audit
python3 code/developer_intervention_tracking.py contract
python3 code/developer_intervention_tracking.py manifest
python3 code/apply_intervention_tracking.py procedure
python3 code/scientific_intervention_validation.py summarize
python3 -m unittest discover -s tests -v
# Verify bundled file integrity (macOS / Linux)
shasum -a 256 data/BtheB_HSAUR_published.csv data/synthetic_events.json
Expected contract output: "passed": true, BtheB: 52, TAU: 48, eight-month observed counts 27 and 25, and zero reference-event issues. Other scripts include descriptive and sensitivity methods; those are not established trial treatment-effect estimators.
8. Python: data-level validation
The following is an independent offline usage example, not a production plugin integration:
import sys
sys.path.insert(0, 'code')
from developer_intervention_tracking import check_event, sample, contract_report
event = sample()
assert check_event(event) == []
assert contract_report()['passed']
# Replayed request key must be rejected
assert 'IDEMPOTENCY_REPLAY' in check_event(event, ('synthetic-event-001',))
# Source revision mismatch must not be silently accepted
event['actual_revision'] = 5
assert 'STALE_REVISION' in check_event(event)
Do not reuse the synthetic actor_id, arbitrary research placeholders or JSON contract fields as real production identifiers.
9. Statistical and psychometric safeguards
Estimand: Prespecify whether the analysis targets an intention-to-treat assignment contrast, per-protocol contrast, actual-exposure association or descriptive trajectory. Treatment assignment is not verified treatment receipt. When estimating treatment effects, distinguish time-varying confounding and post-randomization selection from baseline imbalance, and specify missing-outcome sensitivity assumptions.
Psychometric: BDI-II is a measure of depressive symptom severity, not psychological grit or resilience. Require an instrument-use/license review, score range and item-level scoring rule, baseline/timepoint comparability, relevant reliability and longitudinal invariance evidence. The supplied aggregate scores cannot independently establish item-level validity or treatment response.
Uncertainty: The published eight-month observed-only means are approximately 8.85 and 13.60. The difference (−4.75 points) among the 52 observed participants does not establish a causal treatment effect; almost half of outcomes are missing. Selection and sensitivity analyses must be interpreted under explicit assumptions, not presented as empirical observation of missing values.
10. Security and access tests
Proposed negative cases should explicitly cover missing consent, actor/project mismatch, stale revision, duplicate event ID and idempotency key, source tampering, failed audit persistence, direct-identifier exports, small-cell disclosure, non-private visibility, publication without review, invalid exposure evidence and unsupported individual clinical claims. A local validation result cannot establish tenant isolation or production consent enforcement.
| Boundary | Proposed rejection | Meaning |
|---|---|---|
| Actor project mismatch | ACTOR_SCOPE_DENIED | Do not cross project |
| Idempotency replay | IDEMPOTENCY_REPLAY | No repeated write effects |
| Stale revision | STALE_REVISION | Require merge/reconciliation |
| No verified delivery evidence | DELIVERY_EVIDENCE_UNVERIFIED | Do not assert receipt |
| Export of private data | RESTRICTED_EXPORT | Block until authorized redaction |
| Unreviewed efficacy claim | UNREVIEWED_SCIENTIFIC_CLAIM | Human review required |
11. Failure injection
# These are deliberately invalid offline cases; detection is expected
python3 code/developer_intervention_tracking.py inject --case false_receipt
python3 code/developer_intervention_tracking.py inject --case duplicate_event
python3 code/developer_intervention_tracking.py inject --case replay
python3 code/developer_intervention_tracking.py inject --case actor_scope
python3 code/developer_intervention_tracking.py inject --case missing_consent
python3 code/developer_intervention_tracking.py inject --case audit_failure
python3 code/developer_intervention_tracking.py inject --case restricted_export
python3 code/developer_intervention_tracking.py inject --case psychometric_claim
Each command returns "blocked": true and the corresponding diagnostic code. Failed-case simulations do not persist data, invoke actual APIs or certify live security controls.
12. Troubleshooting
| Symptom | Check | Resolution |
|---|---|---|
| Assigned arm reported as session attended | Is there independent delivered/attended evidence? | Keep receipt unknown; request primary session records |
| Date sequence implausible | Check timezone and occurred/planned timestamps | Quarantine and append verified correction |
| Duplicate events after retry | Inspect event IDs, idempotency key, response status | Deduplicate only with lineage; preserve audit |
| Unexpected BDI-II trend | Inspect baseline, missing outcomes, scoring/version | Qualify, sensitivity-test and review confounders |
| Export reveals identifiable records | Review field redaction, role, project and logs | Disable export and escalate incident |
| Draft appears approved | Review approval events and editorial state | Block publication pending actual human review |
| Unsupported clinical or grit claim | Inspect scale construct and evidence | Remove claim until independent validation |
When escalating, attach only redacted or synthetic fixtures, hashes, nonsecret diagnostic output, source commit and authorized incident reference; do not paste private participant records into public GitHub issues.
13. Source-reviewed repository references
| Verified path | Why it matters |
|---|---|
| README.md | Platform scope, version 2.0.0 and local release contract |
| docs/connected-platform.md | Connected artifact graph and human review |
| docs/monitoring-trends.md | Monitoring snapshots and trend-governance boundaries |
| docs/methodology-profile.md | Source evidence and assumptions |
| docs/persistent-workspace.md | Versioned revisions, content digests and retention |
| docs/institutional-api.md | Framework-neutral API with scopes and audits |
| docs/wordpress-private-workspace.md | Private WordPress surface and nonpersistent demo |
| src/catalyst_grit/storage.py | Repository persistence implementation |
| tests/test_monitoring_trends.py | Monitored immutable snapshots and privacy tests |
| schemas/catalyst_grit_record.schema.json | Recovery records; not clinical trial events |
git clone https://github.com/Content-Catalyst-LLC/catalyst-grit.git
cd catalyst-grit
git checkout f9617160ffd276c6a6fd847b1e846bb5f73b07ae
python3 scripts/release_contract.py
# If test dependencies are installed per repo instructions:
python3 -m pytest tests/test_monitoring_trends.py -q
Repository commands are external to the bundled adapter and must be run in a separate clone. Reviewed source does not establish production environment compliance, installed plugin version or empirical psychometric validity.
14. Verification
| Acceptance criterion | Evidence | Current status |
|---|---|---|
| Original 100-row dataset integrity | Assignment 52/48, wave counts and digest | Offline verified against included transcription |
| Synthetic event contract acceptance | No diagnostics for the bundled safe fixture | Offline tested |
| Security-negative scenarios | Fail closed for 22 injected conditions | Offline tested |
| Real delivery-event provenance | Verified session and environmental-factor records | Not available in published dataset |
| Psychometric validation | Instrument version, rights, reliability, invariance | Not independently established |
| Scientific inference | Research protocol, estimand, uncertainty, sensitivity, reviewer | Not independently signed off |
| Production authorization | Project, tenant, consent, audit and publication tests | Not run |
| Installed release | Operational plugin/service version and migration fingerprint | Not verified |
Offline unit tests demonstrate reference-code behavior only. They do not demonstrate an implemented intervention-tracking API or scientific treatment effectiveness.
15. Reporting, privacy and publication boundary
Reports should disclose trial inclusion, assigned denominators, exact follow-up windows, missing-data fractions, measured outcome definitions, intervention timing evidence, protocol deviations, co-interventions and competing explanations. For regulated or sensitive research, ensure the lawful basis, consent restrictions, ethics approval, data-minimization, participant privacy and validated retention requirements are satisfied. Maintain human approval separate from successful ingestion or verification.
Never infer diagnosis, clinical outcome guarantees, individual grit, worker ranking or eligibility from these research measurements. Do not publish identifiable records, private internal links, access tokens, participant-level longitudinal histories or undisclosed small cells.
16. Scientific references and next steps
- HSAUR — Beat the Blues dataset, variable definitions and provenance.
- Rdatasets — BtheB.csv, upstream independent data check.
- Hoffmann et al. — TIDieR, intervention description and replication reporting.
- CONSORT 2025, randomized-trial reporting and transparency.
- National Research Council — Prevention and Treatment of Missing Data in Clinical Trials, sensitivity analysis.
Next: confirm the installed application version in staging, map approved proposed fields to real storage and permissions, run security and data-parity acceptance tests, obtain psychological/psychometric review, and only then approve any claim of implementation readiness.
