diff --git a/context/current-state.md b/context/current-state.md index 0e4e6ba..204f265 100644 --- a/context/current-state.md +++ b/context/current-state.md @@ -2,9 +2,9 @@ v:1 # current-state -ACTIVE: 2026-07-27 [CC]. TWO separate AIOS/config sessions today, neither is Signal product work. **(1) THIS SESSION, claim-verification build.** Diagnosed one shape across three systems: the policy was real but the enforcement point was missing (the compound relied on Kisa's memory; ground-vs-graft was in all 16 agent files but absent from the main session's own reply path; model routing held only via hand-picked overrides at dispatch). Built the two-half fix: `rate-response` rewritten from 7 checks to ONE claim-honesty gate plus 4 checks, triggering on claim SHAPE rather than confidence, paired with `~/.claude/automation/drift/drift-counter.py` (UserPromptSubmit hook) which scans the transcript mechanically. The DISAGREEMENT between self-report and transcript is the signal, which is why frequency stays absolute. Shapes defined once in `references/claim-shapes.md`. Kisa ruled the options-vs-recommendation scope, resolving a contradiction that spanned 4 files. Also delivered: founder's log created and seeded (11 EARNED entries plus an AVAILABLE index of 332 accelerator notes) and wired into /nuggets and /navaigate-session-brain; copy-review Rule 17 added (readability outside DMEPOS) after `challenger` caught that the first threshold would have condemned the live Signal site; NocoDB token restored via a hidden-prompt script, VERIFIED 200; AIOS Group A COMPLETE, B7 applied (now 6 opus / 10 sonnet), B8 CANCELLED as disproven. Corrected in 4 config files: subagents CAN re-delegate AND call MCP, so the chief-of-staff CLI alias is not required for orchestration. TriLane was never broken and needs no Docker. **(2) EARLIER SESSION: 2026-07-27 [CC]. AIOS/privacy-architecture session, NOT Signal product work. Delivered: STTIL's first data-classification scheme (OPEN/INTERNAL/RESTRICTED, `sttil-vault/Projects/STTIL-data-classification-v1.md`); a dry-run file classifier at `~/.claude/automation/classify/classify.py` (reports only, contains no file-moving code); `~/Documents/Playground/` built; review-hold moved OUT of `~/Documents` to `~/STTIL-Review-Hold/` (iCloud sync risk). Hazel 6.1.2 installed by Kisa, license located and REGISTERED (was on trial). Reference files corrected across two passes after `challenger` caught that the first pass introduced a new false fact. Signal touched only for doc flags, no code change. **PRIOR ACTIVE (still the real product state): 2026-07-07 [CC]. SIGNAL READINESS-MODEL BUILD COMPLETE P1-P6 (final commit 6181de7)**: backend + patient-nested worklist shipped, six independent audits, deployed to Railway + Vercel, live-verified where measurable (171 tests, Pi E2E 33/33, new bundle confirmed serving). All mockup decisions approved incl. the generalized data-gap family. REMAINING: Kisa signed-in click-through (5 probes in ledger). +ACTIVE: 2026-07-27 [CC]. THREE separate sessions today. **(1) THIS SESSION, the Clerk sign-in blocker is ROOT-CAUSED and it was never a Clerk misconfiguration.** Two distinct faults, both GROUNDED by live curl against Clerk's own API. **Fault A, the Vercel URL can never authenticate:** the bundle carries `pk_live_Y2xlcmsuc3R0aWxzb2x1dGlvbnMuY29tJA` which decodes to `clerk.sttilsolutions.com`, a Clerk PRODUCTION instance, and production Clerk rejects any Origin that is not that domain or a subdomain. `Origin: https://signal-ui-xi.vercel.app` returns HTTP 400 `origin_invalid`; `Origin: https://signal.sttilsolutions.com` returns HTTP 200. The missing Google button is a SYMPTOM not a second bug: the `/v1/environment` call that would list `oauth_google` is the one being rejected. **Pilot readiness is therefore 12/13, not 13/13, for as long as the Vercel link is the one under test** — that settles the question left open on 2026-07-07. **Fault B, a successful sign-in lands on the wrong site:** Clerk's `after_sign_in_url` is `https://sttilsolutions.com` (the marketing site) and `sign_in_url` is `https://accounts.sttilsolutions.com/sign-in` (hosted portal, not the app's embedded card), so even on the working domain auth succeeds and dumps the user on the company homepage. Fixing B needs `CLERK_SECRET_KEY` via the Backend API; `~/.claude/automation/set-clerk-secret.sh` was written for it (hidden-prompt pattern cloned from set-nocodb-token.sh, syntax-checked, verifies against api.clerk.com and prints only the HTTP status). Clerk itself is HEALTHY: DNS correct, `oauth_google` ENABLED, email is first factor, **password is NOT a first factor** (email code or Google only, so typing a password was never going to work), signup public, no allowlist. **Cause behind the cause:** `signal-ui/src/main.jsx:10` THROWS on a missing key while `insight-engine/frontend/src/main.jsx:45` returns ``; the throw is why a pk_live had to be baked into the bundle at all. Adopting the IE degrade-gracefully pattern is scoped, NOT built. Also this session: **Playwright MCP restored** (AIOS Group D item 12, `✔ Connected`, tools load on next restart) and **the KG question settled by `challenger`** — 16 entities / 11 triples / 0 expired, every fact dated 07-26 or 07-27, so it is a 2-day-old fresh store rather than a damaged large one. Verdict: mostly empty, build it up, do NOT retire. **ALL KG data lives only in the `-wal` sidecar** (main `.sqlite3` is 4096 bytes and contains no tables), so any copy or backup taken without the sidecar silently yields a valid empty database, which is almost certainly the mechanism behind "KG found empty 2026-07-27". Backup including the sidecar at `~/.mempalace/backup-2026-07-27/`, verified readable at 11 triples. `~/.mempalace/palace/` does not exist at all, so Chroma semantic search is absent while the KG is fine: two separate stores, only one broken, and conflating them is why the reports contradicted each other. scp/SFTP re-confirmed WORKING by three live probes plus sshd_config; the KG triple is false and `vps-safe-commands/SKILL.md` is already corrected; KG NOT modified, awaiting Kisa's ruling. **(2) EARLIER SESSION, claim-verification build.** Diagnosed one shape across three systems: the policy was real but the enforcement point was missing (the compound relied on Kisa's memory; ground-vs-graft was in all 16 agent files but absent from the main session's own reply path; model routing held only via hand-picked overrides at dispatch). Built the two-half fix: `rate-response` rewritten from 7 checks to ONE claim-honesty gate plus 4 checks, triggering on claim SHAPE rather than confidence, paired with `~/.claude/automation/drift/drift-counter.py` (UserPromptSubmit hook) which scans the transcript mechanically. The DISAGREEMENT between self-report and transcript is the signal, which is why frequency stays absolute. Shapes defined once in `references/claim-shapes.md`. Kisa ruled the options-vs-recommendation scope, resolving a contradiction that spanned 4 files. Also delivered: founder's log created and seeded (11 EARNED entries plus an AVAILABLE index of 332 accelerator notes) and wired into /nuggets and /navaigate-session-brain; copy-review Rule 17 added (readability outside DMEPOS) after `challenger` caught that the first threshold would have condemned the live Signal site; NocoDB token restored via a hidden-prompt script, VERIFIED 200; AIOS Group A COMPLETE, B7 applied (now 6 opus / 10 sonnet), B8 CANCELLED as disproven. Corrected in 4 config files: subagents CAN re-delegate AND call MCP, so the chief-of-staff CLI alias is not required for orchestration. TriLane was never broken and needs no Docker. **(2) EARLIER SESSION: 2026-07-27 [CC]. AIOS/privacy-architecture session, NOT Signal product work. Delivered: STTIL's first data-classification scheme (OPEN/INTERNAL/RESTRICTED, `sttil-vault/Projects/STTIL-data-classification-v1.md`); a dry-run file classifier at `~/.claude/automation/classify/classify.py` (reports only, contains no file-moving code); `~/Documents/Playground/` built; review-hold moved OUT of `~/Documents` to `~/STTIL-Review-Hold/` (iCloud sync risk). Hazel 6.1.2 installed by Kisa, license located and REGISTERED (was on trial). Reference files corrected across two passes after `challenger` caught that the first pass introduced a new false fact. Signal touched only for doc flags, no code change. **PRIOR ACTIVE (still the real product state): 2026-07-07 [CC]. SIGNAL READINESS-MODEL BUILD COMPLETE P1-P6 (final commit 6181de7)**: backend + patient-nested worklist shipped, six independent audits, deployed to Railway + Vercel, live-verified where measurable (171 tests, Pi E2E 33/33, new bundle confirmed serving). All mockup decisions approved incl. the generalized data-gap family. REMAINING: Kisa signed-in click-through (5 probes in ledger). -NEXT (as of 2026-07-27): (Kisa, 2 min) sign-in test at signal-ui-xi.vercel.app — decides whether pilot readiness is honestly 13/13 or 12/13; do not quote 13/13 externally until then. (Kisa) rule on the KG conflict below. (Kisa) Appwrite retirement step 1 (`docker compose stop`, reversible, frees 1.3GB and 23 of 28 containers). (CC) design the Hazel ruleset once Kisa supplies the workflow design from her other window. (CC/ops-steward) license + subscription register, Hazel registration email needs moving off the lost lokissed@gmail.com account, transaction ID 8Z4LR26B4D8H. **ADDED 2026-07-27 (claim-verification session):** (Kisa) read the 6 Compound Engineering notes and 8 AIOS layer notes in the vault before the next architecture decision, they sat unread while this system was built and any contradiction in them outranks the build. (CC) AIOS Groups C/D/E need RE-DERIVING before execution: the review assumes 15 agents and there are 16, the omitted one is `challenger`, and 4 of its claims are now disproven (B8 cancelled, Docker unnecessary, COS alias unnecessary, MCP/re-delegation available). (CC) watch `drift-counter.py` for a few sessions, thresholds are reasoned not measured; tune `automation/drift/patterns.txt` if it never fires or fires constantly. (Kisa) `accessibility-review` skill is gone for good, source never existed in any repo; Rule 17 covers the gap but reinstall from origin if you want the original. +NEXT (as of 2026-07-27, sign-in session): **(Kisa) run `bash ~/.claude/automation/set-clerk-secret.sh` in her OWN Terminal** (hidden prompt needs a real tty), then **(Kisa) restart Claude Code** so the Playwright MCP tools load. **(Kisa) rule on the KG scp correction** (proposal below; `challenger` proved the current triple false with three live probes). **(Kisa) confirm `signal.sttilsolutions.com` as the canonical Signal URL** so the readiness checklist can be updated and the Vercel link stops re-causing the sign-in report. **(CC, once CLERK_SECRET_KEY exists)** fix `after_sign_in_url` via the Clerk Backend API, no dashboard; confirm the exact endpoint at that point rather than assuming it. **(CC)** scope the Insight-Engine degrade-gracefully auth pattern into `signal-ui/src/main.jsx` (replace the throw with a keyless demo fallback; unlocks Playwright E2E on the auth path and keyless pilot demos). **(Kisa or CC)** decide on `sqlite3 ~/.mempalace/knowledge_graph.sqlite3 "pragma wal_checkpoint(TRUNCATE);"` to make the KG durable in the main file; backup already taken so this is low risk. **(Kisa)** optional COS alias restore: `echo "alias cos='claude --agent chief-of-staff'" >> ~/.zshrc` — it was never defined on this machine, and `chief-of-staff.md` now carries the MCP tool names so the alias no longer strips knowledge systems. **(CC)** graphify: seed survived at `~/.claude/references/graphify-seed-2026-07-08/` (153 nodes, 122 edges) but `~/projects/trilane/graphify-out/` is EMPTY, so the graph is rebuildable from seed rather than from scratch. PRIOR, still open: (Kisa) rule on the KG conflict below. (Kisa) Appwrite retirement step 1 (`docker compose stop`, reversible, frees 1.3GB and 23 of 28 containers). (CC) design the Hazel ruleset once Kisa supplies the workflow design from her other window. (CC/ops-steward) license + subscription register, Hazel registration email needs moving off the lost lokissed@gmail.com account, transaction ID 8Z4LR26B4D8H. **ADDED 2026-07-27 (claim-verification session):** (Kisa) read the 6 Compound Engineering notes and 8 AIOS layer notes in the vault before the next architecture decision, they sat unread while this system was built and any contradiction in them outranks the build. (CC) AIOS Groups C/D/E need RE-DERIVING before execution: the review assumes 15 agents and there are 16, the omitted one is `challenger`, and 4 of its claims are now disproven (B8 cancelled, Docker unnecessary, COS alias unnecessary, MCP/re-delegation available). (CC) watch `drift-counter.py` for a few sessions, thresholds are reasoned not measured; tune `automation/drift/patterns.txt` if it never fires or fires constantly. (Kisa) `accessibility-review` skill is gone for good, source never existed in any repo; Rule 17 covers the gap but reinstall from origin if you want the original. OPEN DISAGREEMENT (2026-07-27): Kisa said "I don't agree entirely" about the Gmail-recovery / ops-steward proposal and stopped the session before saying which part. **Do not treat that plan as agreed.** Ask her before acting on it. @@ -14,6 +14,7 @@ PRIOR ACTIVE: 2026-06-28. Signal paused at clean checkpoint — Insight Engine i [AIOS build status] The map is written. Highest-impact build is the readiness model, NOT AIOS enhancements. AIOS Phase 1 items (reasoning frameworks, Playground, /board skill) are <5 hours total and optional until Signal has customer momentum. +- 2026-07-27 [CC]: A blocker that survives three weeks is usually the wrong question, not a hard problem. The Clerk sign-in failure was logged 2026-07-07 as "no Google button, debug in progress" and treated as a Clerk misconfiguration. It was neither: a production Clerk key refuses every origin outside its own domain, so the Vercel URL was structurally incapable of authenticating and the missing button was downstream of a rejected API call. Two curls against Clerk's own `/v1/environment`, one per origin, settled in a minute what a fortnight of intermittent debugging had not, because they asked the SERVICE what it thought instead of reading the app. Same shape as the scp lesson: the system does not lie about itself, and the cheapest question is usually the one addressed directly to it. Corollary found the same session: the reason a `pk_live` was in the bundle at all is that `signal-ui/src/main.jsx:10` throws without a key while Insight Engine returns ``, so a design choice about failure modes propagated into an auth outage three layers away. - 2026-07-27 [CC]: A policy with no enforcement point works exactly as often as someone remembers it. Found the same shape in three systems in one day (compound capture, ground-vs-graft, model routing); none of the rules was wrong, all three lacked a trigger wired to the moment they apply. Corollary now built: a self-report inherits the blind spot it is meant to catch, so pair it with a mechanical check and treat the disagreement as the signal. Same day, second proof of the verify-against-the-system rule: the session told Kisa four times that Docker gated TriLane search while line 58 of operating-rules.md already recorded the opposite and the backend was running the whole time. She installed software she did not need. - 2026-07-27 [CC]: Verify claims against the live system, never against a document. I "confirmed" that scp/SFTP were disabled on the VPS by reading the skill file against itself, seeded that false fact into the KG (which outranks every other source), and `challenger` disproved it in one command. Same failure shape as the stale files I was correcting. - 2026-07-27 [CC]: Silent success is this stack's characteristic failure. Eight of nine LaunchAgents gone, the KG empty, `.secrets.env` missing, `~/.claude/plans/` and `raycast/` silently gitignored, Appwrite 502 for weeks. Every one reported success by saying nothing. Assume absence, verify presence. @@ -56,7 +57,7 @@ Insight Engine (July 4 deadline = tomorrow) is the active project. Key files: ## Open Threads (max 5) -- CLERK LOGIN (2026-07-07): Kisa cannot sign in to signal-ui-xi.vercel.app. Observed by CC: the Clerk card shows an email-address-only form (no Google OAuth button) though Google OAuth is configured per stack notes. Gates the P6 click-through. Debug in progress. +- CLERK LOGIN (opened 2026-07-07, **ROOT-CAUSED 2026-07-27**): no longer a mystery. Fault A: `signal-ui-xi.vercel.app` cannot authenticate at all because the production Clerk instance rejects its origin (HTTP 400 `origin_invalid`); the absent Google button is a symptom of that rejected `/v1/environment` call. Fault B: `after_sign_in_url` points at `https://sttilsolutions.com`, so a successful sign-in on the working domain still lands off-app. Remaining work is execution, not diagnosis: Kisa runs `set-clerk-secret.sh`, CC fixes B via the Clerk Backend API, and Kisa confirms `signal.sttilsolutions.com` as canonical. Readiness is 12/13 while the Vercel link is the one being tested. - CONVEX-SIGNAL SPIKE (2026-06-24): design ready (docs/convex-signal-spike-design-2026-06-24.md); separate repo signal-convex; Pi designed. Deps: Kisa's Convex BAA email; repo creation post-approval. Goal: prove Convex on the real product before any platform commitment. - DATA-PLATFORM DECISION (2026-06-24): NocoDB leads broke (no-PK, corrupted source). Options: repaired-NocoDB / Supabase / Neon / AWS / Convex. Leads = non-PHI. Informed by the Convex spike. Interim: capture works; 2 test rows un-deletable. - LEGAL BUNDLE (2026-07-07): **SENT to Clyde Mathes ~2026-07-23 (confirmed by Kisa 2026-07-26); reply expected within days.** Was previously marked READY TO SEND (signal/pitch/legal/attorney-bundle-2026-07-07, 5 docx + sendable memo; rulings applied: Florida, arbitration, Arkisia Fenn signature; verified against the executed labABLE PDF). Open: LOI 8.4 Partner Concepts carve-out keep/drop, memo already asks counsel about its enforceability. Attorney reply gates the FDA memo ruling, AKS guidance, and any LOI/NDA execution with a pilot partner. (Stale READINESS MODEL thread pruned: P1-P6 complete per ACTIVE.) @@ -67,7 +68,7 @@ Insight Engine (July 4 deadline = tomorrow) is the active project. Key files: - Signal: `patient_id` carries the supplier's internal identifier (MRN, account #). Tokenization via RAP-ID/CSP-ID (rotating anonymous ID, not static UUID). Real PHI currently BLOCKED/mock, no active exposure. - **DISPUTED, awaiting counsel (flagged 2026-07-26):** this file previously read "PHI contained in `patient_id`", while `signal/CLAUDE.md:25` states the architecture never stores patient names and that `patient_id` is the sole crosswalk key. Both cannot be true as written. An account number is one of HIPAA's 18 identifiers, and `Barrier-Log.md:16` notes a cipher of an MRN is still derived from identity. **Do not resolve this by picking a side.** The attorney bundle asks counsel this exact question and the answer governs. Until it returns, build to the more restrictive reading: treat `patient_id` as potentially PHI. - Signal-api: Railway (signal-api-production-91c2). Signal-ui: Vercel (signal-ui-xi.vercel.app). Supabase: itmospnregdyiatbbdwl (JWT key). -- Clerk: production key on Vercel + Railway; frontend auth via clerk.sttilsolutions.com; Google OAuth configured. +- Clerk: **PRODUCTION** instance (`pk_live_...` decoding to `clerk.sttilsolutions.com`), key on Vercel + Railway; Google OAuth ENABLED, email is first factor, **password is NOT a first factor** (email code or Google only). **Origin constraint, verified 2026-07-27:** a production instance serves only origins equal to or subdomains of `sttilsolutions.com`, so `signal.sttilsolutions.com` works (HTTP 200) and `signal-ui-xi.vercel.app` is refused (HTTP 400 `origin_invalid`). Both domains serve a byte-identical bundle, so this is a domain problem, never a build problem. `after_sign_in_url` currently points at the marketing site and needs correcting via the Backend API. - Leads: website form -> n8n webhook (n8n.sttilsolutions.com/webhook/signal-cgm-lead) -> NocoDB (Signal base source corrupted, no-PK; capture works, cleanup blocked). Convex spike + platform decision pending. - Compliant fallback: AWS BAA signed 2026-05-27, RDS (signal-db) + S3 provisioned, parked. Convex Professional $25/mo = BAA-capable alternative under evaluation. - TriLane: localhost:8000 (signal/sessions/scale-software). Pi reaches it over HTTP (127.0.0.1:8000); contract in trilane/TRILANE_HTTP_API.md. @@ -81,3 +82,5 @@ State protocol: read = `git pull --rebase` then read this file (warn if Updated ## Updated: 2026-07-07 (CC: nuggets checkpoint x2 — legal bundle rulings applied, verified vs executed PDF, ready to send to Clyde Mathes; TriLane search fixed (dead OpenRouter keys swapped); stale readiness Open Thread pruned. Earlier same day: build complete P1-P6; Clerk sign-in blocker gates the click-through.) Updated: 2026-07-27 [CC] — claim-verification build (rate-response gate + drift counter + claim-shapes), founder's log seeded, copy-review Rule 17, AIOS Group A complete + B7 applied + B8 cancelled. ACTIVE merged with the earlier session, not overwritten. + +Updated: 2026-07-27 [CC] — sign-in session. Clerk blocker ROOT-CAUSED (production-instance origin rejection + wrong after_sign_in_url); readiness corrected to 12/13 on the Vercel link; Playwright MCP restored; KG state settled by challenger (fresh 2-day store, data lives only in the WAL sidecar, palace/Chroma absent); `set-clerk-secret.sh` written. ACTIVE prepended, earlier sessions preserved.