You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three documentation PRs. DOC-7 (inside DOC-A) is the operationally urgent one — it records a deploy prerequisite that is currently absent from the runbooks an operator actually follows.
Line numbers current as of origin/main @ b7edcbc (2026-07-30).
DOC-7 (new, do this first) — commit 10c240c removed the slack_ts inference from _restored_slack_ts (simulation.py:79-102), making scripts/backfill_slack_ts.py --apply a deploy prerequisite on any workspace with pre-Stage-6 history. Without it, every legacy slack_ts IS NULL row reads as DB-origin, _slack_parent_ts (:2718) returns None, and replies to those threads are silently kept off Slack. Commit 7d8b177 measured 60 of 625 rows in the live run as NULL. This is stated in specs/local-db-conversations.md:57-59 and in the _restored_slack_ts docstring, but not in CLAUDE.md or README.md. (Note: 7d8b177's own commit message says legacy NULL rows are safe because "the rebuild's inference … handles them correctly" — 10c240c deleted that inference 1h39m later, so that reassurance no longer holds.)Fix: add the one-time repair step to the CLAUDE.md/README restart runbooks. While in specs/local-db-conversations.md, also fix the "Three processes mint" count at :65 — see PR V11 in the issue Worker & background jobs: id collisions, session rollback, email robustness (4 PRs) #21.
DOC-1 — README.md:92 says to add PIs to a PILOT_LABS list in src/agent/simulation.py (0 matches in src/); :91 says to create a Slack bot token per agent and add it to env config. Both stale — the roster and tokens are DB-driven via AgentRegistry.
DOC-3 — AGENT.md: stale GitHub URL (andrewsu/coPI-python-opus vs SuLab/coPI.science, :7), wrong impersonation path (/api/admin/impersonate vs the real POST /admin/impersonate, admin.py:987), email listed "out of scope" though it is fully built, stale lab counts.
DOC-4 (doc half) — specs/tech-stack.md:213 cites src/models/llm_call_log.py; the model actually lives in agent_activity.py:172.
DOC-5 — templates/base.html:20: posthog.identify('…', {name:'…'{% if … %}, email:'…'{% endif %}); — the object literal is missing its closing } before ), a JS syntax error whenever it renders for a logged-in user. Also: dead prompts prompts/daily_audit.md and prompts/email-reply-classify.md (0 refs in src/); lab counts disagree across docs.
PR DOC-B — Correct the live-roster-sync claims (small)
agent/main.py:84 admits every active agent to the roster regardless of token (the query filters on status == "active" only, :78-80), so _sync_roster_from_db (simulation.py:3589) never picks up a later token for an agent that was active-but-tokenless at boot without a restart. The sync early-returns unless the active-agent_id set changes (if not to_remove and not to_add: return), so bot_name/pi_name edits and post-activation connect_slack are not live either. CLAUDE.md currently claims all of this works without a restart. Fix: correct the CLAUDE.md claim (and/or re-run _load_pi_mappings on field edits — small, optional).
agent_page.py:378-395 lacks the numeric-suffix fallback that scripts/backfill_agents.py:47-69 has, so a double collision hits the unique constraint and 500s; it also mints a bare {LastName}Bot where the scripts and CLAUDE.md specify e.g. PWuBot. Separately: generate_sparsedata_user.py:57 imports the private _extract_json and writes a PII CSV into the non-gitignored scripts/ directory (:854; .gitignore has no csv rule); build_cabo_sankey.py:35 bakes a stale 2026-05-01 default. Fix: align the web collision path with the script logic (numeric fallback + correct bot name); gitignore scripts/*.csv; parameterize the date.
Definition of done: DOC-5's template fix ships with a rendering assertion. DOC-7 is verified by following the runbook end to end on a workspace with legacy rows.
Three documentation PRs. DOC-7 (inside DOC-A) is the operationally urgent one — it records a deploy prerequisite that is currently absent from the runbooks an operator actually follows.
Line numbers current as of
origin/main@b7edcbc(2026-07-30).PR DOC-A — Stale-doc, runbook & JS-bug bundle (trivial)
10c240cremoved theslack_tsinference from_restored_slack_ts(simulation.py:79-102), makingscripts/backfill_slack_ts.py --applya deploy prerequisite on any workspace with pre-Stage-6 history. Without it, every legacyslack_ts IS NULLrow reads as DB-origin,_slack_parent_ts(:2718) returnsNone, and replies to those threads are silently kept off Slack. Commit7d8b177measured 60 of 625 rows in the live run as NULL. This is stated inspecs/local-db-conversations.md:57-59and in the_restored_slack_tsdocstring, but not inCLAUDE.mdorREADME.md. (Note:7d8b177's own commit message says legacy NULL rows are safe because "the rebuild's inference … handles them correctly" —10c240cdeleted that inference 1h39m later, so that reassurance no longer holds.) Fix: add the one-time repair step to the CLAUDE.md/README restart runbooks. While inspecs/local-db-conversations.md, also fix the "Three processes mint" count at:65— see PR V11 in the issue Worker & background jobs: id collisions, session rollback, email robustness (4 PRs) #21.README.md:92says to add PIs to aPILOT_LABSlist insrc/agent/simulation.py(0 matches insrc/);:91says to create a Slack bot token per agent and add it to env config. Both stale — the roster and tokens are DB-driven viaAgentRegistry.AGENT.md: stale GitHub URL (andrewsu/coPI-python-opusvsSuLab/coPI.science,:7), wrong impersonation path (/api/admin/impersonatevs the realPOST /admin/impersonate,admin.py:987), email listed "out of scope" though it is fully built, stale lab counts.specs/tech-stack.md:213citessrc/models/llm_call_log.py; the model actually lives inagent_activity.py:172.templates/base.html:20:posthog.identify('…', {name:'…'{% if … %}, email:'…'{% endif %});— the object literal is missing its closing}before), a JS syntax error whenever it renders for a logged-in user. Also: dead promptsprompts/daily_audit.mdandprompts/email-reply-classify.md(0 refs insrc/); lab counts disagree across docs.PR DOC-B — Correct the live-roster-sync claims (small)
agent/main.py:84admits every active agent to the roster regardless of token (the query filters onstatus == "active"only,:78-80), so_sync_roster_from_db(simulation.py:3589) never picks up a later token for an agent that was active-but-tokenless at boot without a restart. The sync early-returns unless the active-agent_idset changes (if not to_remove and not to_add: return), sobot_name/pi_nameedits and post-activationconnect_slackare not live either. CLAUDE.md currently claims all of this works without a restart. Fix: correct the CLAUDE.md claim (and/or re-run_load_pi_mappingson field edits — small, optional).PR DOC-C — Align the agent-id/bot-name collision path + scripts hygiene (small)
agent_page.py:378-395lacks the numeric-suffix fallback thatscripts/backfill_agents.py:47-69has, so a double collision hits the unique constraint and 500s; it also mints a bare{LastName}Botwhere the scripts and CLAUDE.md specify e.g.PWuBot. Separately:generate_sparsedata_user.py:57imports the private_extract_jsonand writes a PII CSV into the non-gitignoredscripts/directory (:854;.gitignorehas nocsvrule);build_cabo_sankey.py:35bakes a stale2026-05-01default. Fix: align the web collision path with the script logic (numeric fallback + correct bot name); gitignorescripts/*.csv; parameterize the date.Definition of done: DOC-5's template fix ships with a rendering assertion. DOC-7 is verified by following the runbook end to end on a workspace with legacy rows.