Signal/docs/ship-status-ledger.md
Kisa c07d054ca5 Add readiness-model dedup + coverage-line grouping foundation
Group normalized shipment rows into deduped shipments and gradeable
coverage lines (patient -> device -> shipment), the structural fix for the
row-keyed worklist bug (six months of orders no longer = six worklist lines).

- Locked dedup key (patient_id, device_type, date_of_service); order_number
  is display-only. Monthly resupplies stay separate, not duplicates.
- Client-mapped plan_type carried through, never guessed from payer name;
  conflicting plan types in a group route to "plan type needed".
- Quantity merge: sum across distinct component configs, max within a config
  (duplicate guard) with a warning breadcrumb on disagreement.
- CGM gradeable this phase; pumps preserved/displayed but not graded.

Additive only: not yet wired into the live pipeline, grading unchanged.
30 tests green (full suite 46), code-auditor reviewed (M1/M2/L1/L2/L3 fixed).

Design: docs/dedup-design-2026-06-24.md, docs/readiness-model-brief-2026-06-23.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 00:22:01 -04:00

61 lines
7.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Signal — Ship-Status Ledger
Canonical, git-tracked record of **what shipped, what didn't, and the reason or dependency** for anything outstanding. Both Pi and Claude read and maintain this; Kisa validates. Ship-status never lives only in private memory. Update this on every ship or blocker change. Pairs with `context/current-state.md` (this = the detailed ledger; current-state = the live ACTIVE/NEXT snapshot).
**Status legend:** SHIPPED · IN PROGRESS · BLOCKED · NOT STARTED · DEFERRED · PI-SIDE · PARKED
---
## Ledger (as of 2026-06-24)
| # | Item | Owner | Status | Reason / Dependency | Next action |
|---|------|-------|--------|---------------------|-------------|
| 1 | Claude-side delegation trigger (`dispatch-trigger.sh` + settings.json `UserPromptSubmit` hook + dispatch thresholds) | Claude | **SHIPPED** (verified live) | none | done |
| 2 | Audit Finding 1 — hook stdout injection works | Claude | **SHIPPED** | verified live (marker reached the model) | done |
| 3 | Audit Finding 2 — `$1` bug → read stdin JSON | Claude | **SHIPPED** | caught + fixed during build | done |
| 4 | Audit Finding 4 — old+new dispatch rules conflict | Claude | **SHIPPED** | added clarifying line (kept judgment fallback, marker = evaluate not auto-dispatch) | done |
| 5 | Convex-Signal spike **brief** | Claude | **SHIPPED** (committed this wrap) | — | Pi designs from it |
| 6 | Convex-Signal spike **design** | Pi | **SHIPPED** | docs/convex-signal-spike-design-2026-06-24.md. 40h/3-phase plan; Module map + Repository interface + Convex schema + Auth seam (Convex default, Clerk swappable) + Phase 1 (core readiness loop) = what Claude builds first. | Claude builds Phase 1 from it |
| 7 | `signal-convex` repo creation | Claude (GitHub) + Kisa/token (Forgejo) | **PENDING** | Dependency: Pi design + Kisa approval (create once, correctly). Claude can do GitHub via `gh`; Forgejo has no API token here. | after design approved |
| 8 | Convex BAA email (plan/cost/signing) | Kisa | **IN PROGRESS** | Kisa handling | Kisa sends |
| 9 | Readiness-model build (rename coverage→readiness, rules-to-config, grouping+verdict, device override, require-plan-type, frontend nesting) | Claude | **IN PROGRESS** | Step 3 grouping half SHIPPED 2026-06-26: `core/dedup.py` (CSVRow→MergedShipment→CoverageLine) + 30 tests green, code-auditor reviewed (no High; M1/M2/L1/L2/L3 fixed). Added additive `plan_type` field to ShipmentRecord (default None; live grading untouched). NOT yet wired into the live pipeline. Remaining: required-vs-input verdict engine, rules-to-addressable-config (IDs), device-keyed override+recompute+rollup, require-plan-type enforcement + remove name-guesser/default, frontend nesting + "plan type needed" state. | Next: build the verdict engine + rules-to-config; WIRE orchestration in `api/main.py` or a new pipeline module, NOT inside `coverage_calculator` (dedup imports from it → circular import). Each step code-auditor-reviewed before ship. |
| 10 | NocoDB leads / CRM cleanup | Claude + Kisa | **BLOCKED** | Reason: leads table has no primary key (Signal-base data source `bdmhi02nks1pg6g` is corrupted — a fresh table there also came up PK-less; content base is healthy). SQLite can't add a PK to a populated table (Route 1 failed). Interim: capture still works (inserts via n8n `signal-cgm-lead`); the 2 test rows can't be deleted. | resolved by the data-platform decision (item 11) |
| 11 | Data-platform decision (leads + future PHI backend) | Kisa (with Claude/Pi analysis) | **OPEN** | Options analyzed: repaired-NocoDB / Supabase Postgres / Neon / AWS (already set up, BAA+RDS+S3 parked) / Convex ($25/mo incl. BAA). Leads = non-PHI (stay outside PHI boundary). Decision informed by the Convex spike. | run spike → decide |
| 12 | Research-versioning Layer-1 (`research-autopush.sh` + Stop-hook entry) | Claude | **NOT STARTED** | Dependency: Pi design exists (`docs/research-versioning-design-2026-06-24.md`). Lower priority than product. | next infra slot |
| 13 | `signal/docs/` auto-versioning (Audit Finding 5) | Claude + Pi | **NOT BUILT** | Reason: research-versioning scope excludes `signal/docs/`. **This is why design docs need manual commits.** | add `signal/docs/` to scope |
| 14 | Pi research-versioning ext `tool_call`→`tool_result` (Finding 3) | Pi | **LIKELY DONE** | Pi state reports persist gap closed (8 file writes this session); confirm it is the tool_result fix | Pi confirm |
| 15 | Mid-session commit push on clean tree (Finding 6) | Claude | **DEFERRED** | optional, low risk, adds session-close latency | revisit if loss occurs |
| 16 | Chief-of-staff sequential-dependency capability (Finding 7) | Claude | **NOT TESTED** | Dependency: a discovery test with a sequential multi-specialist brief | run the test |
| 17 | Pi injected-message behavior (Finding 8) | Pi | **NOT TESTED** | Pi-side test | Pi test |
| 18 | Skills-as-git-repo (Finding 9) | Claude/Pi | **DEFERRED** | Phase 2 per workflow-consolidation plan | phase 2 |
| 19 | Website copy + agent-file fixes | lead-content / Claude | **STAGED, not deployed** | prose rewrites routed to lead-content; BAA wording attorney-gated | deploy when ready |
| 20 | Signal AIOS product | — | **PARKED** | Activate only on demand-pull + Signal self-sustaining + delegable capacity | hold |
---
## Timeline / critical path
1. **Next session:** (a) Kisa gives the dedup decision → Claude builds the readiness model (item 9). (b) In parallel, Pi designs the Convex-Signal spike from the committed brief (item 6).
2. **After Pi's Convex design:** Kisa validates → create `signal-convex` (item 7) → Claude builds the spike.
3. **Convex spike + BAA terms (item 8)** → inform the data-platform decision (item 11) → which resolves the NocoDB leads/CRM fix (item 10).
4. **Infra cleanup (batched in slack):** research-versioning Layer-1 + `signal/docs/` scope (items 1213, the reason docs need manual commits), then low-priority Findings 6/7/9. Findings 3/8 are Pi-side.
5. **Fixed date:** labABLE `/pilot-prep` Fri 2026-06-26 1:30 PM.
## Dependencies summary
- Readiness build ⟸ Kisa dedup decision.
- Convex spike build ⟸ Pi design ⟸ committed brief (ready) ; and ⟸ Kisa approval + repo creation.
- NocoDB/leads fix ⟸ data-platform decision ⟸ Convex spike evidence + BAA terms.
- Design-doc durability ⟸ `signal/docs/` auto-versioning (until built, commit docs manually).
## Maintenance
Update this whenever an item ships or a blocker changes. Move shipped items to a `## Shipped (archive)` section when the table grows. Both agents reason from this; Kisa validates and redirects.
## Design Verification (2026-06-24, Claude)
Pi's dedup design (item 9) and Convex-spike design (item 6) were verified line-by-line. Both are build-ready; fixes applied directly to the design docs:
- **dedup-design-2026-06-24.md**: (1) added a separate client-mapped `plan_type` field, distinct from display `payer`, so CoverageLine keys on the mapped plan type, never the payer name — the original draft reintroduced the killed plan-type-guessing bug. (2) Fixed `merge_quantities` to sum across distinct component configs; the old blanket-max dropped quantity in mixed duplicate+split groups (e.g. two [sensor] + one [transmitter] returned 3 instead of 4).
- **convex-signal-spike-design-2026-06-24.md**: `shipments.orderNumber`/`hcpcs` changed to arrays (post-dedup multi-value); §11 dedup note de-staled to LOCKED; carry-forward note to grade on the mapped `planType`.
- Noted, not a blocker: "Convex auth -> Clerk = config-only swap" is optimistic; treat as low-but-nonzero effort (Convex Auth still maturing).