Cohesion: Python inventory + integration plan + Phase A (auditor→observer+KB) #7

Closed
profit wants to merge 1 commits from cohesion/python-inventory-and-integration into main
Owner

What J asked for

  1. Inventory Python scripts — hooked vs dead
  2. Design the integration test for the smarter-DB loop
  3. (Implicit) make progress on actually wiring the loop, not just documenting it

What this PR does

  • docs/PYTHON_INVENTORY.md — every .py file classified. Two confirmed dead in sidecar; 5 overlap with newer TS. Cleanup deferred to a subsequent PR (operator decision).
  • docs/COHESION_INTEGRATION_PLAN.md — 6-phase plan (A-F) for the loop. Each phase adds one wire.
  • Phase A live: auditor verdicts now POST to observer :3800/event with source=auditor AND append to data/_kb/outcomes.jsonl with kind=audit. Observer source type extended from mcp|scenario to mcp|scenario|auditor|bot.

Live-verified

After observer restart + re-audit of PR #6:

observer by_source={'auditor': 1}
_kb/outcomes.jsonl: kind=audit sig=pr6-7fe47bab pr=6 overall=request_changes

Not shipping here

Phases B-F of the cohesion plan. Each is its own PR. Phase B (kb_query reads prior audit history from the rows Phase A now creates) is the natural next.

## What J asked for 1. Inventory Python scripts — hooked vs dead 2. Design the integration test for the smarter-DB loop 3. (Implicit) make progress on actually wiring the loop, not just documenting it ## What this PR does - `docs/PYTHON_INVENTORY.md` — every .py file classified. Two confirmed dead in sidecar; 5 overlap with newer TS. Cleanup deferred to a subsequent PR (operator decision). - `docs/COHESION_INTEGRATION_PLAN.md` — 6-phase plan (A-F) for the loop. Each phase adds one wire. - **Phase A live:** auditor verdicts now POST to observer :3800/event with `source=auditor` AND append to `data/_kb/outcomes.jsonl` with `kind=audit`. Observer source type extended from `mcp|scenario` to `mcp|scenario|auditor|bot`. ## Live-verified After observer restart + re-audit of PR #6: ``` observer by_source={'auditor': 1} _kb/outcomes.jsonl: kind=audit sig=pr6-7fe47bab pr=6 overall=request_changes ``` ## Not shipping here Phases B-F of the cohesion plan. Each is its own PR. Phase B (`kb_query` reads prior audit history from the rows Phase A now creates) is the natural next.
profit added 1 commit 2026-04-22 22:22:44 +00:00
Cohesion: Python inventory + integration plan + Phase A verdict indexing
All checks were successful
lakehouse/auditor all checks passed (3 findings, all info)
6e39d8778f
Three artifacts in one PR:

1. docs/PYTHON_INVENTORY.md — every .py file in the repo classified:
   Production (sidecar routers + 3 systemd services), Documented
   (kb_measure, kb_staffer_report), Manual (one-off tools), Dead
   (sidecar/sidecar/lab_ui.py + pipeline_lab.py are genuinely
   not imported anywhere).

2. docs/COHESION_INTEGRATION_PLAN.md — the "smarter DB" loop J
   called out as missing. Six phases A-F. Phase A ships here; B-F
   are named + sequenced for follow-up PRs. Each phase adds ONE
   wire of the loop; no single PR does them all.

3. Phase A wire (auditor verdicts → observer + KB):
   - auditor/audit.ts: after assembleVerdict, fire-and-forget POST
     to :3800/event with source="auditor" AND append to
     data/_kb/outcomes.jsonl with kind="audit". Errors log + drop
     — the verdict is still on disk at _auditor/verdicts/.
   - mcp-server/observer.ts: extend source union to include
     "auditor" | "bot" (was "mcp" | "scenario" only, which silently
     coerced my first auditor POST to source="scenario"). Accept
     body.ok OR body.success. Accept body.audit_duration_ms as a
     fallback for duration_ms. Uses body.one_liner as
     output_summary when set.

Live-verified after observer restart:
   re-audit PR #6 → verdict=request_changes, 4 findings (1 warn)
     observer: by_source={'auditor': 1}  (previously coerced to 'scenario')
     _kb/outcomes.jsonl tail: kind=audit sig=pr6-7fe47bab
       pr=6 overall=request_changes

The shape of the loop is now visible to downstream consumers. Phase
B (auditor's kb_query check reads these audit rows for history)
lands in a follow-up PR. Phase C-F similar.

NOT in this PR:
- Actually deleting lab_ui.py + pipeline_lab.py (operator decision,
  called out in the inventory doc)
- Cleaning up the 5 overlapping Python scripts (same)
- Phases B-F of the cohesion plan (separate PRs per wire)
- Integration test that asserts "smarter DB" across runs (Phase F)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
Owner

Auditor verdict: approve

One-liner: all checks passed (3 findings, all info)
Head SHA: 6e39d8778f4f
Audited at: 2026-04-22T22:23:03.481Z

dynamic — 1 findings (0 block, 0 warn, 1 info)

ℹ️ info — dynamic check skipped — skipped by options

  • skipped by options
inference — 1 findings (0 block, 0 warn, 1 info)

ℹ️ info — no ship-claims extracted — skipping cloud inference

  • parser returned empty claim list; nothing to verify against cloud
kb_query — 1 findings (0 block, 0 warn, 1 info)

ℹ️ info — KB: 71 recent scenario runs, 210/291 events ok (fail rate 27.8%)

  • most recent: ?
  • recent failing sigs: 5745bcd5e4c68591, caeeeffc69d36009, pr6-7fe47bab

Metrics

{
  "audit_duration_ms": 75,
  "findings_total": 3,
  "findings_block": 0,
  "findings_warn": 0,
  "findings_info": 3,
  "claims_strong": 0,
  "claims_moderate": 0,
  "claims_weak": 0,
  "claims_total": 0,
  "diff_bytes": 18759
}

Lakehouse auditor · SHA 6e39d877 · re-audit on new commit flips the status automatically.

## Auditor verdict: ✅ `approve` **One-liner:** all checks passed (3 findings, all info) **Head SHA:** `6e39d8778f4f` **Audited at:** 2026-04-22T22:23:03.481Z <details><summary><b>dynamic</b> — 1 findings (0 block, 0 warn, 1 info)</summary> ℹ️ **info** — dynamic check skipped — skipped by options - `skipped by options` </details> <details><summary><b>inference</b> — 1 findings (0 block, 0 warn, 1 info)</summary> ℹ️ **info** — no ship-claims extracted — skipping cloud inference - `parser returned empty claim list; nothing to verify against cloud` </details> <details><summary><b>kb_query</b> — 1 findings (0 block, 0 warn, 1 info)</summary> ℹ️ **info** — KB: 71 recent scenario runs, 210/291 events ok (fail rate 27.8%) - `most recent: ?` - `recent failing sigs: 5745bcd5e4c68591, caeeeffc69d36009, pr6-7fe47bab` </details> ### Metrics ```json { "audit_duration_ms": 75, "findings_total": 3, "findings_block": 0, "findings_warn": 0, "findings_info": 3, "claims_strong": 0, "claims_moderate": 0, "claims_weak": 0, "claims_total": 0, "diff_bytes": 18759 } ``` <sub>Lakehouse auditor · SHA 6e39d877 · re-audit on new commit flips the status automatically.</sub>
Author
Owner

Closing as stale. 10 days drift, not mergeable, auditor verdict request_changes with 4-6/10 alignment scores from KB scrum. Content disposition:

  • docs/PYTHON_INVENTORY.md — partially obsoleted; the dead-code claim about lab_ui.py + pipeline_lab.py is now correctly tracked as dev-only UIs (sidecar drop landed ba928b1 2026-05-02 confirms they are not on the runtime hot path)
  • docs/COHESION_INTEGRATION_PLAN.md — overlapped by today's unified longitudinal session JSONL (gateway + validatord both write to same path with daemon= field; cross-runtime parity probes lock in equivalence)
  • Phase A wire (auditor → observer + KB) — direction is now subsumed by the parity fabric. Re-open as a fresh PR if a specific wire is still missing.

If you want the Python inventory doc on main, cherry-pick 6e39d87 for that file only.

Closing as stale. 10 days drift, not mergeable, auditor verdict `request_changes` with 4-6/10 alignment scores from KB scrum. Content disposition: - `docs/PYTHON_INVENTORY.md` — partially obsoleted; the dead-code claim about `lab_ui.py` + `pipeline_lab.py` is now correctly tracked as dev-only UIs (sidecar drop landed `ba928b1` 2026-05-02 confirms they are not on the runtime hot path) - `docs/COHESION_INTEGRATION_PLAN.md` — overlapped by today's unified longitudinal session JSONL (gateway + validatord both write to same path with `daemon=` field; cross-runtime parity probes lock in equivalence) - Phase A wire (auditor → observer + KB) — direction is now subsumed by the parity fabric. Re-open as a fresh PR if a specific wire is still missing. If you want the Python inventory doc on `main`, cherry-pick `6e39d87` for that file only.
profit closed this pull request 2026-05-03 03:36:48 +00:00
All checks were successful
lakehouse/auditor all checks passed (3 findings, all info)

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: profit/lakehouse#7
No description provided.