Skip to content

HOLISTIC PROBE r2 — read-mostly state audit (2026-10-07) ​

Task: t_049e1aa6. Read-mostly probe; sole write is this file. No source/test/script edits, no commits, no artifact edits, no systemd changes, no repo-wide tsc run. Written 2026-10-08T00:13Z (probe session opened 2026-10-07T23:11Z).

Authority: AGENTS.md + latest artifacts/seo-context/2026-10-07T05-42-52-944Z/supervisor.report.md. Predecessor: r1 = docs/2026-10-06-post-pin-probe.md (t_97ae42e6, declared sha256 c9a97c39e41719f0d78f62b796abb554b30ae9b0680154ffcbc21e61a1e8afb4).


0. META — r1's findings file is NOT in the tree (P1, new since r1) ​

r1's deliverable docs/2026-10-06-post-pin-probe.md is absent from the working tree. It was swept into a user stash at 2026-10-07 16:11:56Z:

  • git stash list → stash@{0}: On main: wip-before-security-remediation (sha 7ca73aec09a177eb372543939f9cf040242c252b, author KinoThe-Kafkaesque, 16:11:56Z).
  • Its untracked leg stash@{0}^3 carries the file: git show --stat 'stash@{0}^3' → docs/2026-10-06-post-pin-probe.md | 230 ++++.
  • Byte-exact recovery verified: git show 'stash@{0}^3:docs/2026-10-06-post-pin-probe.md' | sha256sum = c9a97c39e41719f0d78f62b796abb554b30ae9b0680154ffcbc21e61a1e8afb4 — identical to r1's declared post-edit sha.
  • Presence check across refs: main absent, backup/saas-wip-20261006 absent, stash@{0}^3 present.

Impact: r1's findings are unreachable by any path-based reader (docs/*2026* glob is empty; git ls-files docs/operations shows no probe). The pin-campaign history now lives only inside a stash entry whose subject is unrelated ("wip-before-security-remediation"), so the next reader following the card's "locate r1's findings file" instruction finds nothing.

  • Next action (card-sized, product-scope, NOT fleet): restore the r1 file from stash@{0}^3 (or re-file its content under a tracked path) and link it from the SEO tracker, so the post-pin audit chain is reachable. Owner: whoever owns the repo stash / docs hygiene. SEO fleet does not take it. Evidence pointer: the sha match above.

Note on this probe's own file placement: r1's convention was docs/<date>-<topic>-probe.md in the saas tree. This file follows it as docs/2026-10-07-probe-r2.md. It is created UNTRACKED; if the same stash/sweep behaviour recurs it will vanish the same way (see §7).


1. STATE vs TRACKER — live-vs-backup split is NOT accurately represented (P1) ​

r1 established the contract-era SEO machinery lives only on backup/saas-wip-20261006 (and /dev/shm/backup-scripts). r2 confirms the split and adds a sharper finding: live surfaces still point at the parked modules, so the split is understated in the tracker.

1a. Live tree does not contain the contract-era modules (confirmed) ​

Absent from live scripts/ (all PRESENT on backup/saas-wip-20261006): seo-capability-claim-matrix.ts, seo-run-summary.ts, seo-run-summary-executor.ts, seo-cohort-provenance.ts, seo-capability-copy-gate.ts, seo-homework-ledger.ts, seo-homework-invariants.ts, seo-homework-reconcile.ts, seo-scope-preflight.ts, seo-webbridge.ts, seo-deploy-workflow.ts, seo-executor-handoff.ts, seo-pipeline-order.ts, seo-event-trigger.ts, seo-cadence-controller.ts. Test files: live scripts/*.test.ts = 10; backup = 40.

Live scripts/seo-context-agent.ts imports only ./seo-output-schema (which is live).

1b. Live doc describes modules that do not exist in the live tree (P1) ​

docs/seo-agent.md (tracked; mtime 2026-10-06 18:41Z) states at :121-129:

scripts/seo-cadence-controller.ts is the deterministic control layer above the two SEO timers… Run bun run seo:cadence for a read-only preview or bun run seo:cadence -- --apply… The lightweight health unit calls the context collector with --health-only. It checks the configured public endpoints without invoking Codex, the supervisor, Search Console, GA4, broad SERP scraping, homework, or rendered parity collection.

Both claims are false against the live tree: scripts/seo-cadence-controller.ts does not exist (seo:cadence in package.json → MISSING target), and the live context agent does not implement --health-only (see §2). This is tracker/doc drift on a tracked doc, so it is discoverable without the backup branch — the split is not merely "modules parked", it is "live docs advertise parked behaviour as shipped".

1c. package.json + systemd reference two scripts that are missing from the live tree (P1) ​

package.json:41 (tracked, HEAD): "seo:health": "KINO_SEO_CONTEXT_RUNS_DIR=artifacts/seo-health bun run scripts/seo-context-agent.ts --health-only".

Systemd user units (read-only inspection) whose ExecStart targets a missing script:

UnitExecStart targetLive
kinoforms-seo-event-trigger.service:12scripts/seo-event-trigger.ts --applyMISSING
kinoforms-seo-cadence-controller.service:12scripts/seo-cadence-controller.ts --applyMISSING
kinoforms-seo-agent.servicescripts/seo-agent-orchestrator.tspresent
kinoforms-seo-context.servicescripts/seo-context-agent.tspresent
kinoforms-seo-health.service:13scripts/seo-context-agent.ts --health-onlypresent (flag ignored — §2)

Observed consequence (read-only, journal):

  • event-trigger timer fires every 30m and exits 1 with error: Module not found "…/scripts/seo-event-trigger.ts" (4 consecutive failures 22:30→00:02Z).

  • cadence-controller exits 1 (last 2026-10-07 06:25:52Z).

  • The cadence drop-in ~/.config/systemd/user/50-adaptive-cadence.conf does not exist, so no adaptive cadence is applied; cadence/decisions.jsonl last appended 2026-10-06 09:20Z.

  • Next action (card-sized): reconcile the live tree with its own advertised surfaces — either restore seo-event-trigger.ts + seo-cadence-controller.ts from backup/saas-wip-20261006, or remove the two units + the seo:cadence script + the docs/seo-agent.md §cadence/health paragraphs. Do NOT merge the whole backup; scope to the two referenced scripts or the doc/unit removal. Evidence: package.json:41, the two service files, the journal exits above.


2. HEALTH-ONLY REGRESSION — the health unit runs the FULL collector and is killed every run (P1) ​

The live scripts/seo-context-agent.ts parses --smoke only; grep -c 'healthOnly' = 0. The backup + /dev/shm copies carry the flag (grep -c healthOnly = 2 each, with the if (healthOnly) { … finish(runDir, "health_checked", …) } block).

So the unit that is supposed to be "lightweight public health" silently falls through to the full collector path. Measured consequence for every 2026-10-07 health run:

Run dirFiles writtensummary.jsonsweepnotebook-publishOutcome
2026-10-07T00-31-52-922Z131absentabsentabsentkilled at timeout
2026-10-07T06-30-52-919Z131absentabsentabsentkilled at timeout
2026-10-07T12-33-03-467Z131absentabsentabsentkilled at timeout
2026-10-07T18-33-52-945Z131absentabsentabsentkilled at timeout

Journal (all four): start operation timed out. Terminating. / code=killed, status=15/TERM / Failed with result 'timeout' (TimeoutStartSec=20m; 18:33:52→18:53:53, 55.9s CPU). Compare the last properly-finished health run, 2026-10-06T18-36-31-463Z: 2 files, summary.json status health_checked, 11.9s wall (run.json 18:36:31 → summary.json 18:36:43). The regression began exactly at the 18:41:49Z park / 18:41:57Z ff-pull (the parked tree carried the flag; the synced main does not).

Each failing run burns ~20 min of timer time, ~55s CPU, and writes 131 files (106 SERP captures, GA4 pulls, homework-reports/pass-01) into an audit directory that never reaches a terminal summary.json. No uncaught-error.json and no summary.json are written, so the failure is invisible to any reader that keys on run status.

  • Next action (card-sized): restore --health-only handling in the live scripts/seo-context-agent.ts from backup/saas-wip-20261006 (the flag + the early health_checked finish block), OR change the unit + package.json:41 to stop passing the flag. Either way the unit must reach a terminal summary.json. Evidence: the 4 killed dirs vs the 10-06 dir; grep -c healthOnly = 0 live / 2 backup.

3. TESTING GAPS on the live scripts/ set ​

Live baseline re-measured this probe: bun test scripts/ → 137 pass / 0 fail / 1942 expects across 10 files, exit 0 (up from r1's 125/0 — the delta is t_eed680df's 12 new regression tests). Live modules with NO test file (16 non-test seo modules, 10 tested):

Moduleexportsnote
seo-agent-orchestrator.ts44,452 lines; the largest untested surface
seo-supervisor-agent.ts0644 lines, zero exports — CLI-only boundary
seo-failure-agent.ts0926 lines, zero exports
seo-check.ts0zero exports (r1 noted: no honest boundary)
seo-sensitive-audit.ts6exports present, no test
seo-output-schema.ts2exports present, no test

t_eed680df's fix is now well-pinned: inferHomeworkStatusFromEvidence early-return at scripts/seo-context-agent.ts:3668-3670 plus scripts/seo-context-agent.test.ts:619-703 (4 new tests: answered-not-downgraded, blocked-not-upgraded GSC, blocked-not-upgraded GA4, unvalidated-slot-still-fillable, answered-ends-pass-loop).

  • Next action (card-sized): one boundary-pin card per still-untested live module with a real export surface — start with seo-sensitive-audit.ts (6 exports) then seo-output-schema.ts (2). Zero-export CLI modules (seo-check, seo-failure-agent, seo-supervisor-agent) get a CLI status-gate pin instead of an import pin.

4. SECURITY SURFACE (read-only) ​

  • No shell: true anywhere in live scripts/ (grep -rc 'shell: *true' → 0). All spawn/spawnSync calls use argv arrays (curl, git, pgrep, gcloud, bun, codex), so no shell-injection surface from these call sites.

  • Secrets sweep clean: grep -rniE 'PRIVATE KEY|sk-live|ghp_|AKIA|xox[bp]-' scripts/seo-*.ts → 0 hits. The Bearer *** strings are redaction literals (seo-agent-orchestrator.ts:2486,2570,2839, scrub at :4360-4361); GOOGLE_SEARCH_CONSOLE_ACCESS_TOKEN is read from env, never persisted. (grep-grade, not a scanner; .env untouched per policy.)

  • normalizeRelativePath still does not resolve .. (r1 F4, unchanged). Live copies at scripts/seo-agent-orchestrator.ts:2153 and scripts/seo-failure-agent.ts:767 are identical: value.trim().replace(/\\/g,"/").replace(/^\.\//,""). Probe: "a/../../x" → "a/../../x", "../secret.ts" → "../secret.ts". Both feed matchesScopePattern (orchestrator:2137, failure-agent:771), i.e. the executor/failure scope gate. Inputs are executor-generated (git diffs / changed-file artifacts), matching is pure string compare (no fs access), so the worst case is a gate misjudgment, not file access — same reachability class r1 assigned. New since r1: the canonical seo-scope-preflight.ts the fix was supposed to live in is parked, so there is now no single place to fix it — two live copies must change together.

  • Producer-without-reader (new, from t_eed680df). The card added homework-sweep.receipt.json (scripts/seo-context-agent.ts:82,4048-4057, reader requireSweepCompletionReceipt at :4062-4125) but the supervisor's selection lists (seo-supervisor-agent.ts:266-291 priorityPatterns and the role selectors) do not name it — grep receipt scripts/seo-supervisor-agent.ts = 0. The receipt is enforced in-process (the investigator prerequisite) but is invisible to the run's own auditor, so a supervisor reviewing a run cannot see the ordering evidence the fix exists to create.

  • Next action (card-sized): add /^homework-sweep\.receipt\.json$/ to the supervisor's priorityPatterns (and optionally the homework_scraper role patterns) so the ordering receipt the fix produces is anchored. Evidence: seo-supervisor-agent.ts:266-291; producer at seo-context-agent.ts:4057.


5. VALIDATION GAPS / EXPLORATION ​

  • Live-fleet coherence (axis 5). Newest run = artifacts/seo-context/2026-10-07T05-42-52-944Z, grade D, status collected_with_material_orchestration_defects, human-attention false (supervisor.report.md:1-6). The two error: classes the report names are exactly the two defects t_eed680df fixed afterwards (status reducer overriding validated verdicts; investigation running before sweep completion). So the live supervisor grade D is pre-fix; the fix is not yet observable in a live run (no context run has happened since 05:42Z). This is a validation gap, not a defect: the fix is unit-proven but not run-proven.

  • Producer-side gaps (carried from t_eed680df's next_todos, re-confirmed live):

    • .agents/seo/state.json updated_at = 2026-06-08, tracked_keywords = 17 — the cohort source is stale; no run dir carries a versioned cohort/provenance record.
    • No run emits goal_ids/goal_outcomes (the summary details keys carry none) and none reads docs/seo-change-ledger.json for due-verdict coverage. These are the same three contract-era gaps; they remain open.
  • Fleet-worktree divergence (confirmed). scripts/seo-context-agent.ts in the workspace (sha d96d4d8c…) differs from the fleet worktree copy /home/nyanpasu/.local/state/kinoforms-seo-agent/worktree/scripts/seo-context-agent.ts (sha fc152296…, = t_eed680df's pre-edit baseline, grep -c healthOnly = 0 there too). If the dispatcher runs the fleet from that worktree, t_eed680df's fix does not reach production runs.

  • Stale locks. ~/.local/state/kinoforms-seo-agent/run.lock (mtime 2026-10-06 03:04Z, 0 bytes) persists with no orchestrator process alive; the 2026-10-07 04:35Z seo-agent timer run died with SEO agent is already running and exit 1. context.lock holds pid 3749428, which is dead (stale). Lock acquisition is openSync(lockFile,"wx") with rmSync only in the finally of a normal exit (seo-agent-orchestrator.ts:580-590), so a SIGKILL/timeout leaves a permanent lock. Last successful seo-agent run = 2026-10-06T03-04-53-587Z; the agent lane has not produced a run in >24h.

  • Exploration/research options (unchanged from r1, still worth a bounded probe): mechanized producer-without-reader sweep (enumerate every *.json a live writer persists vs the supervisor's selection lists); paraphrase-drift measurement against the claim inventory; external-shape spot check for GA4/provenance evidence.

  • Next action (card-sized): (a) make the orchestrator's run/context lock stale-safe (pid liveness check or timeout reclaim) so a killed run does not wedge the agent lane; and (b) decide whether the fleet dispatcher reads the workspace tree or the worktree copy, then propagate t_eed680df's fix to whichever tree actually runs. Evidence: run.lock mtime + 04:35Z journal; the two sha256 values.


6. FENCES — observed, never decided ​

  • NEEDS-USER #1 bundle (R-INV-2.3 fail-publication strictness, classifyClaimunknowable→live, the §7 SPEC GAPs, untracked-repo governance): unchanged; nothing implemented or amended. New observation: r1's "29 §7 bullets across six SEO-* docs" are only on the backup branch — the live docs/operations/SEO-CAPABILITY-CLAIM-MATRIX.md is a different, non-contract doc (a dated claim-audit with sections "Executive summary / Claim matrix / Open follow-ups / Appendix", 117 lines) that does not contain a §7 SPEC GAP section (grep '§7' = 0). So the live tree advertises a same-named doc with none of the contract content; the six R-* contract docs (OPS-FINAL-SUMMARY-RECONCILE, OPS-HOMEWORK-STATUS-FIDELITY, OPS-POST-SWEEP-INVESTIGATION-ORDER, SEO-CAPABILITY-COPY-GATE, SEO-EFFECTIVE-COHORT-PROVENANCE, SEO-GA4-CLOSED-LOCAL-WINDOW, SEO-RUN-SUMMARY-CONTRACT, SEO-WEB-ACTION-EVIDENCE) are absent from live docs/operations/. Recorded, not acted on.
  • AWAITING EXTERNAL: pin-surface restore/merge decision on backup/saas-wip-20261006 (r2 cost/benefit in §1: the parked surface is now referenced by live units and docs, which raises the cost of leaving it parked); seo-event-trigger runbook answer; category-release ledger entry (ledger still has 3 entries due 2026-10-13 with no verdict, and the category commit 769d9e1/workflow remains absent).
  • artifacts/ read-only — untouched. No systemd unit restarted or rewired. No repo-wide tsc run (per fence). bun invoked via ~/.bun/bin.

7. Ranked findings + card-sized next actions ​

P1

  1. r1's findings file missing from the tree (recoverable byte-exact from stash@{0}^3, sha c9a97c39…). → restore/re-file it and link from the tracker.
  2. --health-only no longer handled in live seo-context-agent.ts; the health unit runs the full collector and is killed at the 20m timeout on every 2026-10-07 run (131 files, no terminal summary.json). → restore the flag or change the unit/package.json.
  3. Live units + package.json + docs/seo-agent.md reference missing scripts (seo-event-trigger.ts, seo-cadence-controller.ts); both units fail on every tick. → reconcile (restore the two scripts or remove the units/script/doc paragraphs).

P2 4. docs/seo-agent.md:121-129 documents cadence + health-only behaviour that the live tree does not implement (tracked-doc drift). → same card as (3) or a doc-fix card. 5. Producer-without-reader: homework-sweep.receipt.json (new in t_eed680df) is not in the supervisor's selection lists. → add it to seo-supervisor-agent.ts:266-291. 6. Stale run.lock (2026-10-06 03:04Z, no owner) wedges the seo-agent lane; context.lock holds a dead pid. → make locks stale-safe. 7. Six live seo modules remain untested (orchestrator first). → boundary-pin cards. 8. Fleet-worktree copy (fc152296…) still carries the unfixed reducer; fix not propagated to whichever tree the dispatcher runs. → decide the tree and propagate.

P3 9. normalizeRelativePath (two live copies) does not resolve ..; no single canonical home now that seo-scope-preflight.ts is parked. → fold into whichever restore card lands. 10. r1's own file is untracked; this r2 file is likewise untracked and will vanish under the same sweep. → track probe deliverables (or move them under a tracked docs path).

No action — human-gated: R-INV-2.3 direction; classifyClaim unknowable→live; all §7 SPEC GAP ratifications (29 on the backup branch); untracked-repo governance; the pin-surface restore/merge decision.


Verification ledger (commands actually run) ​

  • git stash show -p stash@{0} --stat → includes docs/2026-10-06-post-pin-probe.md | 230 ++++ (exit 0).
  • git show 'stash@{0}^3:docs/2026-10-06-post-pin-probe.md' | sha256sum → c9a97c39e41719f0d78f62b796abb554b30ae9b0680154ffcbc21e61a1e8afb4 (exit 0; matches r1's declared post-edit sha).
  • git cat-file -e <ref>:docs/2026-10-06-post-pin-probe.md for main/backup/stash@{0}^3 → absent/absent/present.
  • grep -c 'healthOnly' scripts/seo-context-agent.ts → 0; git show backup/saas-wip-20261006:scripts/seo-context-agent.ts | grep -c healthOnly → 2; grep -c healthOnly /dev/shm/backup-scripts/seo-context-agent.ts → 2.
  • ls artifacts/seo-health/2026-10-07T*/ → 4 dirs, 131 files each, no summary.json; last finished = 2026-10-06T18-36-31-463Z (2 files, health_checked).
  • journalctl --user -u kinoforms-seo-health.service --since '2026-10-07' → 4× start operation timed out … code=killed, status=15/TERM.
  • journalctl --user -u kinoforms-seo-event-trigger.service → 4× Module not found "…/scripts/seo-event-trigger.ts", status=1.
  • for f in seo-cadence-controller seo-event-trigger; do test -e scripts/$f.ts; done → both MISSING; git ls-tree backup/saas-wip-20261006 -- scripts/ → both present.
  • bun test scripts/ (via ~/.bun/bin) → 137 pass / 0 fail / 1942 expects / 10 files, exit 0.
  • grep -rc 'shell: *true' scripts/*.ts → 0; secrets sweep → 0 hits.
  • grep -n receipt scripts/seo-supervisor-agent.ts → 0 (receipt unanchored); producer at seo-context-agent.ts:4057.
  • sha256sum scripts/seo-context-agent.ts → d96d4d8c…; fleet worktree copy → fc152296….
  • git log --all -S healthOnly -- scripts/seo-context-agent.ts → only e2f8c74 (the parked backup commit); origin/main blob → 0.
  • NOT run: no browser, no deploys, no systemd restart, no full-repo tsc, no live SEO run.

Residual risk ​

  • Point-in-time reads of a live tree; the 30-min event-trigger timer and user sessions can write after any read above (the 00:02Z event-trigger failure was observed mid-probe).
  • healthOnly/backup claims rest on read-only git object reads, not a checkout; the parked tree was never materialised.
  • Grep-grade security only; no scanner, no dependency audit.
  • The "which tree the dispatcher runs" question (P2-8) is stated as a fork, not resolved — the dispatcher config was not in scope to read.

KinoForms documentation