From 8cd66b51b25663f18ad090016b0b983828c11515 Mon Sep 17 00:00:00 2001 From: Sinity Date: Sat, 8 Aug 2026 07:28:21 +0200 Subject: [PATCH 1/4] test(infra): restore focused harness contracts Shared archive templates carried durable bootstrap identity for the template path into private clones, causing valid facade tests to fail during startup reconciliation. Rebind the bootstrap receipt after cloning and cover the cloned archive through the real ArchiveStore route.\n\nThe embedding stats contract mock also ignored bound SQLite parameters after the shared introspection refactor, so every table probe appeared present. Inspect the bound table name and preserve the intended legacy fallback assertions.\n\nVerification: devtools test selected seven focused regression cases, all passed. --- tests/conftest.py | 7 +++++++ tests/unit/storage/test_vec.py | 8 +++----- tests/unit/test_pytest_temp_policy.py | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 3533f81ca1..3aaff9d0e7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -736,6 +736,13 @@ def _clone_archive_template(source: Path, destination: Path) -> None: except (OSError, subprocess.CalledProcessError, subprocess.TimeoutExpired): shutil.copytree(source, destination, dirs_exist_ok=True) + bootstrap_marker = destination / ".maintenance-state" / "durable-change-trains" / ".bootstrap" + if bootstrap_marker.is_file(): + from polylogue.storage.sqlite.durable_change_train import _record_fresh_durable_bootstrap + + bootstrap_marker.unlink() + _record_fresh_durable_bootstrap(destination) + @pytest.fixture(scope="session") def empty_archive_template( diff --git a/tests/unit/storage/test_vec.py b/tests/unit/storage/test_vec.py index a28e983264..b37a0def55 100644 --- a/tests/unit/storage/test_vec.py +++ b/tests/unit/storage/test_vec.py @@ -418,10 +418,10 @@ def test_get_embedding_stats_contract( connection = MagicMock() def execute(sql: str, params: tuple[object, ...] | None = None) -> MagicMock: - del params if operational_error: raise sqlite3.OperationalError("Table not found") - if "sqlite_master" in sql and "sessions" in sql: + inspected_table = params[0] if "sqlite_master" in sql and params else None + if inspected_table == "sessions": return MagicMock(fetchone=MagicMock(return_value=None)) # embedded_message_count_sync (polylogue-q88p) checks # message_embedding_refs, then message_embeddings_meta, then @@ -429,9 +429,7 @@ def execute(sql: str, params: tuple[object, ...] | None = None) -> MagicMock: # table this fixture pins its count against -- report the first # three as absent so the count query lands on the same # "message_embeddings" branch this fixture always exercised. - if "sqlite_master" in sql and ( - "message_embedding_refs" in sql or "message_embeddings_meta" in sql or "message_embeddings_rowids" in sql - ): + if inspected_table in {"message_embedding_refs", "message_embeddings_meta", "message_embeddings_rowids"}: return MagicMock(fetchone=MagicMock(return_value=None)) if "message_embeddings" in sql: return MagicMock(fetchone=MagicMock(return_value=[msg_count])) diff --git a/tests/unit/test_pytest_temp_policy.py b/tests/unit/test_pytest_temp_policy.py index aaa440da48..ad2cc3eee1 100644 --- a/tests/unit/test_pytest_temp_policy.py +++ b/tests/unit/test_pytest_temp_policy.py @@ -236,3 +236,21 @@ def test_archive_template_clone_is_private(tmp_path: Path) -> None: (destination / "index.db").write_bytes(b"private-mutation") assert (source / "index.db").read_bytes() == b"immutable-template" + + +def test_archive_template_clone_rebinds_durable_identity(tmp_path: Path) -> None: + from polylogue.storage.sqlite.archive_tiers.archive import ArchiveStore + + source = tmp_path / "source" + destination = tmp_path / "destination" + marker_relative = Path(".maintenance-state/durable-change-trains/.bootstrap") + with ArchiveStore(source): + pass + source_marker = (source / marker_relative).read_bytes() + + conftest._clone_archive_template(source, destination) + + assert (destination / marker_relative).read_bytes() != source_marker + with ArchiveStore(destination): + pass + assert (source / marker_relative).read_bytes() == source_marker From 896b79fec983a2004f6fd1e7b64a07176f9ab5d3 Mon Sep 17 00:00:00 2001 From: Sinity Date: Sat, 8 Aug 2026 08:56:16 +0200 Subject: [PATCH 2/4] chore(beads): track harness contract repair Record the two current-master harness regressions discovered while validating polylogue-mn0si. The scoped Bead binds the clone identity and embedding-stat fixture behavior without absorbing the unrelated full-suite residual population. --- .beads/issues.jsonl | 1 + 1 file changed, 1 insertion(+) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index d4739789ad..41e679e171 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -1747,3 +1747,4 @@ {"_type":"issue","id":"polylogue-fs1.5","title":"Export: Atropos/eval JSONL downstream of the canonical archive","description":"Convert archived Hermes (and other agent) sessions into Atropos-compatible eval/RL trajectories: canonical archive -> eval JSONL, NOT bespoke snapshot->export (that shape is a one-off parser and duplicates Hermes's own NeMo Relay). Round-trip through Nous's jsonl2html.py viewer as the acceptance check. Generalizes to the training-flywheel story: longitudinal trajectories with structural outcome labels + human judgments.","design":"Downstream export only: canonical archive session -> Atropos/eval JSONL (trajectory = messages + tool calls + structural outcomes + terminal state). VERIFY the current Atropos trajectory schema in NousResearch/atropos before freezing field names; round-trip the output through their jsonl2html.py viewer as the acceptance check. Implementation home: a render/export profile over the read substrate (like read-package layouts), not a script silo. Selection is a normal query ('find ... then export --format atropos'), so any slice of the archive (by origin/repo/outcome) can become an eval set. Prior prototype existed (hermes-forensics.zip, earlier session) — treat as reference only.\n\nTRAINING-FLYWHEEL DIRECTIONS (fables interop analysis — the most original bridge; nobody currently connects personal agent archives to the open-model training loop): (a) fine-tuning corpus — outcome-labeled, judgment-filtered trajectories for training personal model variants on one's own successful workflows; the assertion judgment gate doubles as the data-quality filter (only human-accepted work patterns qualify), structural outcomes (exit codes, terminal states) select success without trusting self-report. (b) pathology taxonomy -> eval environments: agent_hanging, question_left, thrash-loop signatures mined from real work as seed material for Atropos-style RL/eval environments, reproducible via the synthetic corpus so the environments are shareable without private data. Both are downstream projections of the same export lane — build the lane once, add selection/filter profiles.","acceptance_criteria":"`polylogue-fs1.5` emits an export/interchange artifact that preserves stable object refs, evidence provenance, caveats, and content hashes. A roundtrip or consumer fixture proves no duplicate facts and no silent loss of missing/private blobs. Verification artifact: OriginSpec detector/parser/fixture/fidelity suite and content-hash export/import roundtrip.","notes":"CORPUS CORRECTIONS (2026-07-06 review pass): (1) VERIFY the live Atropos schema at implementation time — it is a moving framework with recent format fixes around nested messages; pin the schema version + round-trip a validator/renderer (jsonl2html) as a mandatory test. (2) Corrections are SESSION-SCOPED => weak supervision, not fine-grained ground truth: any reward/eval report MUST carry base rate, n, correction granularity, and coverage. (3) Export is a pure read projection — no write path. Verbatim spec: .agent/handoffs/polylogue-gpt-pro-2026-07-06/bundles/rnd-bundle-1-of-6.md L1675.\n2026-07-06 D07 rerun landed (on-brief; preserved as corpus-gpt-pro-2026-07-06/DR2-07-rl-eval-environment.md). Design it settles and this bead adopts: (1) first export target = atropos-eval-jsonl profile (messages + scores is viewer-compatible immediately); NOT Harbor/Terminal-Bench (heavy task materialization), NOT SWE-bench (patch-centric), NOT OpenAI Evals (deprecation path late 2026), NOT ATIF (observability carrier, no reward semantics — stays an IMPORT format on fs1.2). (2) Three-way reward split is the core honesty contract: recorded_reward (derived from archived evidence, e.g. verify exit_code=0), replay_spec (git SHA, workspace snapshot ref, env manifest, network policy, timeouts), checkable_reward (null until replay actually reruns the verify command). Never conflate recorded with checkable. (3) Field mapping keys on existing evidence — tool_result_is_error, tool_result_exit_code, verify command text+cwd, git SHA, user.db corrections as session-level weak supervision (do NOT invent step-level labels), keystone evidence_ref back to the archive. NO fabricated tokens/masks/logprobs — that lane exists only after a replay substrate exists. (4) Highest-value slice: CI-passing sessions with an explicit verify command + stable git SHA — the verify command IS the seed of a rerunnable reward function.\n[Delivery upgrade 2026-07-07T00:05:00Z] Release=K-interop-origin-export; lane=origin-interop-export; readiness=D-horizon-ready; proof=OriginSpec detector/parser/fixture/fidelity suite and content-hash export/import roundtrip. Original readiness=E-spec-needed.\nDeferred (no new code) -- genuinely new export feature, not a composition of already-existing primitives like fs1.4 turned out to be.\n\nThe bead's own 2026-07-06 D07 rerun notes already settle the design in detail (atropos-eval-jsonl profile; three-way recorded_reward/replay_spec/checkable_reward split with checkable_reward null until a real replay substrate exists; field mapping keyed on tool_result_is_error/tool_result_exit_code/verify command text+cwd/git SHA/user.db corrections as session-level weak supervision). That design is sound and directly implementable -- I did not find a reason to defer on design grounds. The reason for deferring in THIS pass is time/verification-surface budget: this cluster's frontier work (fs1.7/fs1.2/fs1.11, PR #2876) plus honest investigation of fs1.4/fs1.8/fs1.13/ox0 consumed the available session budget, and I judged rushing a new JSONL export format + roundtrip fixture without adequate test depth to be worse than an honest deferral with the design already fully specified.\n\nNo code written. The settled design above (also visible verbatim in this bead's own notes) is ready for direct implementation by the next agent without further research: highest-value slice = CI-passing sessions with an explicit verify command + stable git SHA (the verify command is the seed of a rerunnable reward function).\n[2026-07-18, res-01 deep-research finding, GPT-Pro wave-2] External deep-research memo (mission: .agent/handoffs/external-agent-campaigns/2026-07-17-gpt-pro-wave-2/missions/res-01-atropos-tinker.md; deliverable at /realm/inbox/download/deep-research-report.md, access-dated 2026-07-17) confirms and dates this bead's own 2026-07-06 D07 design decision rather than overturning it: NousResearch/atropos is now ARCHIVED and read-only as of 2026-07-04 (last tagged release v0.4.0 2026-03-10, last visible main-branch merge 2026-03-27) -- do not treat it as a stable first-class external contract. The live Atropos API transport is the `ScoredData` Pydantic model at `/scored_data` (README prose says \"ScoredDataGroup\" but the enforced server shape is `ScoredData`), now including optional `distill_token_ids`/`distill_logprobs` distillation arrays (Tinker only supports K=1). `tinker-atropos` is a real Atropos-to-Tinker LoRA training bridge but requires per-item `tokens`, `scores`, and `inference_logprobs` -- it does NOT ingest Hermes `state.db` or raw transcripts directly, so \"import history -> train a small delta\" is NOT true for arbitrary historical archives without a token-faithful reconstruction layer this bead does not have.\nRecommendation this bead should adopt: sequence contracts as ATIF-v1.7 first (normalized, versioned, externally documented trajectory contract -- already the fs1.2 IMPORT format, consistent with this bead's own note that ATIF \"stays an IMPORT format on fs1.2\"), ATOF-0.1 as preferred raw input when available, and Atropos/tinker `ScoredData` export only as an OPTIONAL derived adapter gated on real token/logprob availability -- never market Hermes `state.db` alone as sufficient for a tinker-atropos training path. This directly reinforces (does not replace) the existing D07 three-way recorded_reward/replay_spec/checkable_reward design and the \"atropos-eval-jsonl profile (messages+scores, jsonl2html-viewer-compatible)\" as the right FIRST export shape -- it is narrower than full Atropos `ScoredData` and does not depend on the archived repo's continued maintenance. Local falsifier proposed by the memo: try to populate `tokens`+`inference_logprobs` from a real Hermes `state.db` + ATIF sample without model reruns or fabrication -- if that fails (expected), keep the Atropos/tinker export gated as a second-stage adapter, not the canonical target.\n[Verification sweep 2026-07-31, bead-landing-check group5] Verdict: LIVE. Notes explicitly: \"Deferred (no new code)... No code written.\"","status":"open","priority":4,"issue_type":"feature","owner":"ezo.dev@gmail.com","created_at":"2026-07-03T04:31:42Z","created_by":"Sinity","updated_at":"2026-07-31T22:35:43Z","labels":["area:ingest","area:query","area:substrate","delivery:K-interop-origin-export","delivery:ac-patched","lane:origin-interop-export"],"dependencies":[{"issue_id":"polylogue-fs1.5","depends_on_id":"polylogue-fs1","type":"parent-child","created_at":"2026-07-03T06:31:41Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.5","depends_on_id":"polylogue-fs1.1","type":"blocks","created_at":"2026-07-03T06:31:42Z","created_by":"Sinity","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"polylogue-fs1.4","title":"Report: polylogue forensics for Hermes sessions","description":"Five-section per-session/per-corpus report, computed from the canonical archive (composition over existing primitives where possible): 1) session topology — parents, resumes, compactions, subagents, branches, long turns; 2) LLM/request economy — token lanes, cost, retry/fallback causes, model/provider shifts, cache-read amplification; 3) tool execution profile — durations, failures, approvals, repeated calls, parallel groups; 4) failure patterns — loops, stalls, empty-response retries, repeated shell failures, truncation, compaction-induced loss, reasoning burn; 5) local causal footprint — git diff/commits, commands, files, build/test runs. The 2-minute demo artifact (sanitized sessions, one command, README section) is the campaign-grade packaging of this report.","design":"Composition first: sections 1-3 and most of 4 should lower onto existing primitives — get_session_topology/logical session (topology), session_provider_usage_events + cost rollups (economy), actions/tool timing (tool profile), pathology detectors + structural outcomes (failure patterns), session_commits/git correlation (footprint). Only add new detectors where Hermes-specific (loop detection over repeated identical tool calls; stall = long gap between spans; reasoning burn = reasoning-token share per turn). Surface: a named read view/report profile (`polylogue forensics hermes --session ` or read --view forensics), rendered markdown + JSON. Demo packaging: sanitized fixture sessions, one command, <2min, README section — that packaging is a legitimate one-off; the five sections' facts must be query-composable (capabilities-not-silos rule).","acceptance_criteria":"A Hermes forensic report regenerates from imported Hermes sessions and emits citable findings with coverage/fidelity caveats, raw evidence refs, and a single documented regeneration command. The report includes at least one happy-path fixture, one missing-field/degraded fixture, and one fidelity limitation that renders visibly instead of silently disappearing.","notes":"Executable upgrade (2026-07-04 sidecar):\nClassification: blocked on polylogue-fs1.1 for real Hermes state.db ingestion, but the report contract can be made executable now against synthetic/fixture sessions and later rerun on real Hermes rows.\nProduct question: can Polylogue produce a cold-reader forensic report that explains one Hermes/agent session better than the runtime itself, using canonical archive facts rather than a silo export?\nLikely modules/surfaces: read/query surfaces under polylogue/cli/read or command inventory, session topology/logical-session APIs, session_provider_usage_events/cost rollups, actions/tool timing readers, git/local footprint helpers, demo fixture/scenario generators, docs/demo shelf. Prefer a named report/read view that composes existing primitives; avoid a Hermes-only data path.\nArtifact shape: markdown + JSON report with the five existing sections, each section carrying source_refs/query names and missing-data caveats. Demo package must include sanitized fixture/session id, one command, expected runtime under 2 minutes, and a README snippet.\nAcceptance detail: for fixture data, each section has at least one asserted fact and one source reference; for missing Hermes fields, the report emits explicit unavailable/caveat rows rather than prose guesses; once fs1.1 lands, rerun against a real Hermes session and record diff between fixture and real coverage.\nVerification commands: focused unit/visual/demo command for the report surface, plus devtools render all --check if docs/README/demo surfaces are touched. If the implementation adds a new CLI command or view, verify command inventory and generated docs through devtools render all.\n[Delivery upgrade 2026-07-07T00:05:00Z] Release=K-interop-origin-export; lane=origin-interop-export; readiness=A-implementation-ready; proof=OriginSpec detector/parser/fixture/fidelity suite and content-hash export/import roundtrip. Original readiness=C-needs-acceptance-criteria.\n[Prework packet 2026-07-07] Static execution packet (anchors, mechanism, plan, tests, verification): .agent/handoffs/polylogue-gpt-pro-2026-07-07/prework-v2/task_packets/105_polylogue_fs1_4.md (depth: bead-localized-from-export; urgency: T2-foundation-before-feature-proof). Generated from master @ 8a975a40 2026-07-06 — verify source anchors before coding; line numbers are snapshot-relative.\n2026-07-10 integration-demo refinement: fs1.12 consumes this report. Include a claim-vs-tool-evidence canary with supported, contradicted, and unknown states; every displayed conclusion must resolve to structured tool outcome evidence and a fidelity caveat, not agent prose.\n2026-07-10 Nous follow-up technical refinement: use an evidence-status taxonomy that distinguishes supported, contradicted, later repaired/reversed, externally uncheckable, and unverifiable because required evidence was not retained. Preserve temporal ordering and evidence-retention caveats so later success cannot launder an earlier contradicted claim. Reuse the general claim-vs-evidence/claims-ledger substrate; do not create Hermes-only verdict semantics.\nDeferred (no new code) -- investigated and found the design's own preferred shape (\"composition first... avoid a Hermes-only data path... only add new detectors where Hermes-specific\") is already substantially satisfied by existing generic primitives, verified by reading their source (not assumed):\n\n- Section 1 (session topology): get_session_topology / logical session APIs -- already exist, origin-agnostic.\n- Sections 2-4 (LLM/request economy, tool execution profile, failure patterns): polylogue/insights/postmortem.py's compile_postmortem_bundle. Verified it is 100% origin-agnostic (SessionProfile.origin is a plain string field, zero origin-conditional branches in the aggregator) and already produces cost/token-lane metrics, tool-category profiles, and pathology-detector failure_mode/wasted_loop fields with evidence refs and honest degraded-not-fabricated behavior for missing signal (test_compile_postmortem_bundle_degrades_without_signal already covers this generically).\n- Section 5 (local causal footprint): polylogue/insights/session_commit.py's detect_session_commits -- git-commit attribution via time-window + file-overlap scoring, already exists, origin-agnostic.\n\nWhat's genuinely missing, and why I did not build it this pass: (a) a NAMED regeneration surface (a `polylogue forensics hermes --session ` command or `read --view forensics`) unifying these existing primitives under one command -- mechanical but real work that triggers the CLI-inventory/devtools-render-docs cascade; (b) the claim-vs-tool-evidence canary / evidence-status taxonomy the bead's own 2026-07-10 refinement explicitly says to build on \"the general claim-vs-evidence/claims-ledger substrate\" -- that substrate does not exist yet, so building Hermes-only verdict semantics here would violate the refinement's own instruction not to invent parallel machinery.\n\nDid not add a redundant \"hermes-flavored\" test of compile_postmortem_bundle: since the aggregator has zero origin-conditional logic, a test asserting it also works with origin=\"hermes-session\" would be vacuous (guaranteed to pass, proves nothing a mutation could break that the existing origin-agnostic tests don't already cover).\n\nRecommend: a follow-up scoped narrowly to (a) the CLI/read-view wiring only, composing the primitives above with zero new detector logic -- and treat the claim-vs-evidence canary as blocked on its own substrate bead, not this one.\n2026-07-18 (Claude Sonnet, branch feature/fix/hermes-atof-remaining-gaps): landed the verification-coverage correlation primitive that Phase 3's verification-ledger import (wj25) unblocked -- polylogue/insights/hermes_verification_coverage.py, a pure aggregator (no I/O) summarizing one Hermes session's verification_evidence.db coverage: structural event outcomes, final status, changed_paths, honest available=False (not fabricated) when no verification evidence exists. Also added hermes_verification.hermes_verification_session_id_for mirroring hermes_spans's existing observer-correlation helper. Verified via real archive ingestion (LiveBatchProcessor), not hand-built fixtures. 3/3 tests, devtools verify --quick green.\n\nDid NOT attempt in this pass, per this bead's own prior 2026-07-14 finding that sections 1-4 are 'substantially satisfied by existing generic primitives' and the recommended narrow follow-up is 'the CLI/read-view wiring only': the named CLI regeneration surface (read --view forensics or similar), the per-corpus aggregate ('sessions ended with failing/absent verification'), the 2-minute demo package (sanitized fixtures, one command, README section), and MCP tool wiring. This was a deliberate scoping decision given session budget, not an oversight -- the correlation primitive was the one piece genuinely blocked on Phase 3 landing first; the rest is composition/wiring work that deserves its own focused pass (CLI read-view registration triggers the docs-render cascade per this repo's own gotchas list).\n2026-07-18 merge: PR #3120 squash-merged to master as b563083188926b2078965ea41c2028a0a305577e. Verification-coverage correlation primitive (hermes_verification_coverage.py) is now live on master. Bead stays open: named CLI/read-view surface, per-corpus aggregate, 2-minute demo package, and MCP wiring remain undone per this pass's explicit scoping decision (see prior note).\n[Verification sweep 2026-07-31, bead-landing-check group5] Verdict: LIVE. Substantial composition-based delivery (PR #3120 verification-coverage correlation) but explicit remaining scope: named CLI/read-view surface, per-corpus aggregate, demo package, MCP wiring - \"deliberate scoping decision... not an oversight.\"\nUNBLOCKED 2026-07-31 (polylogue-pbuh/cijx.1 residual pass, worktree agent-aaffe89902b670d4b): the session->PR producer+reader chain this bead depends on is now real. session_refs carries typed pull_request evidence (18,949 rows live), and PR #3425 (merged 5525446a2) wired `read --view correlation` / Polylogue.session_correlation_payload to consume it as authoritative over the old regex/time-window heuristics, with disagreements surfaced rather than silently guessed. Verified live against /realm/db/polylogue/index.db (read-only) that the CLI path resolves real typed PR refs end-to-end (also fixed a pre-existing NameError in that path's GitHub-enrichment branch that had never been exercised with real refs before this pass). Full detail: polylogue-cijx.1 and polylogue-pbuh notes, 2026-07-31.\n\nNOT closed by this alone: this bead's own AC still needs its specific deliverable (see this bead's own description) beyond \"the correlation data is now readable\" -- that implementation work was not attempted in this pass (out of its declared scope: read-surface residual verification for pbuh/cijx.1 only). Re-triage this bead's own AC against the now-working session_commit.py/correlation_view.py surface when picked up next.\n","status":"open","priority":4,"issue_type":"feature","owner":"ezo.dev@gmail.com","created_at":"2026-07-03T04:31:41Z","created_by":"Sinity","updated_at":"2026-07-31T22:35:46Z","labels":["area:ingest","area:query","area:substrate","delivery:K-interop-origin-export","delivery:ac-patched","lane:origin-interop-export"],"dependencies":[{"issue_id":"polylogue-fs1.4","depends_on_id":"polylogue-cijx.1","type":"blocks","created_at":"2026-07-29T06:52:02Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.4","depends_on_id":"polylogue-fs1","type":"parent-child","created_at":"2026-07-03T06:31:40Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.4","depends_on_id":"polylogue-fs1.1","type":"blocks","created_at":"2026-07-03T06:31:41Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.4","depends_on_id":"polylogue-fs1.3","type":"blocks","created_at":"2026-07-10T11:03:54Z","created_by":"Sinity","metadata":"{}"}],"dependency_count":3,"dependent_count":2,"comment_count":0} {"_type":"issue","id":"polylogue-fs1.2","title":"Importer: NeMo Relay ATOF/ATIF runtime spans","description":"Import Hermes observer-layer trace exports as runtime span evidence: pre/post_api_request -> LLM request spans; pre/post_tool_call -> tool execution spans with duration/status; approval hooks -> high-risk decision points; subagent hooks -> delegation graph; error hooks -> retry/fallback taxonomy. ATIF import + enrichment beats inventing another trajectory format — respect Hermes's actual extension seams and make Polylogue the normalizer.","design":"VERIFY first: current NeMo Relay plugin output shape in the Hermes repo (ATOF JSONL / ATIF JSON exported from observer hooks). Ingest route: new artifact kinds in the taxonomy (archive/artifact_taxonomy/) + a spans parser under sources/parsers/, landing as ObservedEvents/actions attached to the session (join key: Hermes session id from the trace envelope -> sessions.native_id). Map: pre/post_api_request pair -> LLM request span (duration, model, provider, token fields if present); pre/post_tool_call -> tool execution span with duration/status (structural outcome — feeds is_error/exit_code lanes where present); approval hooks -> decision-point events; subagent lifecycle -> topology_edges (subagent type); error hooks -> retry/fallback taxonomy events. Spans without a matching archived session become explicit acquisition debt rows, not silent drops.","acceptance_criteria":"`polylogue-fs1.2` adds or updates an origin contract with detector, parser, raw fixture, normalized fixture, parser fingerprint, and fidelity/completeness notes. Ambiguous inputs are handled deterministically. The regression suite proves idempotent replay and visible degraded/missing-field behavior. Verification artifact: OriginSpec detector/parser/fixture/fidelity suite and content-hash export/import roundtrip.","notes":"[Delivery upgrade 2026-07-07T00:05:00Z] Release=K-interop-origin-export; lane=origin-interop-export; readiness=D-horizon-ready; proof=OriginSpec detector/parser/fixture/fidelity suite and content-hash export/import roundtrip. Original readiness=E-spec-needed.\n2026-07-10 Hermes contract refinement: ingest context_injected with profile/session/turn/snapshot-revision correlation; unpaired spans remain explicit acquisition debt. fs1.7 owns atomic spool/export production; this bead owns normalization and reconciliation.\nImplemented and PR opened (not merged): #2876 (feature/hermes/lifecycle-spool-and-bridge).\n\nScope understood: import Hermes observer-layer (NeMo Relay) trace exports as runtime span evidence, normalized and reconciled per the design's mapping (pre/post_api_request -> LLM request spans, pre/post_tool_call -> tool spans, approvals -> decision points, subagent hooks -> delegation evidence, error hooks -> retry/fallback taxonomy).\n\nHonesty constraint documented explicitly in code + PR: the real ATOF/ATIF wire shape was not independently verifiable from this workspace -- no local checkout of the Hermes observer-plugin source was available. sources/parsers/hermes_spans.py implements a documented, testable, best-effort marker-based schema derived from this bead's own design notes and the shared lifecycle taxonomy (hermes_lifecycle.py, fs1.7). Every fidelity capability the parser declares tops out at \"inferred\", never \"exact\", for this reason -- filed as a concrete follow-up (fs1.2.1, not yet created as a bead by me -- flagging here so the orchestrator can file it) to re-verify against real Hermes source and tighten fidelity if it matches without changing the public contract.\n\nWhat changed: sources/parsers/hermes_spans.py (detector/parser/fidelity), wired into the real dispatch pipeline (sources/dispatch.py: detect_provider, lowering, parse_payload -- same path every other origin uses, not a bespoke test-only entrypoint); new artifact-taxonomy classification (archive/artifact_taxonomy/runtime.py).\n\nAC checklist: origin contract with detector/parser/raw fixture/normalized fixture/parser fingerprint/fidelity notes -- satisfied (marker_payload() is the raw-fixture generator used by every test; normalized output is the ParsedSession/session_events produced; fidelity via import_fidelity_declaration()). Ambiguous inputs handled deterministically -- satisfied: unrecognized hook_type -> generic hermes_observer_span event (never dropped, never misclassified as a known kind); malformed span entries (missing hook_type/span_id, non-dict entries) are skipped and counted, not crashing. Idempotent replay -- satisfied and tested (test_atif_parse_is_idempotent_and_deterministic: same document parsed twice -> byte-identical structural output). Visible degraded/missing-field behavior -- satisfied: unpaired spans (start without finish) are counted and surfaced as an explicit degraded fidelity capability with a caveat, never silently dropped.\n\nDesign gap explicitly NOT closed, documented not silently assumed: physical merge of observer spans into the state-db-ingested conversational session's message tree (the design's \"landing as ObservedEvents/actions attached to the session\"). This parser instead produces its own observer-evidence session (observer:) with a read-side correlation helper (hermes_observer_session_id_for) joining by the shared raw Hermes session id -- a physical content-tree merge across two independently-acquired artifacts is a session-identity/lineage design decision (topology_edges/session_links) I judged out of scope for this pass rather than improvising a schema-adjacent change.\n\nVerification: devtools test tests/unit/sources/parsers/test_hermes_spans.py -- 9/9 passed (subset of PR's 43-test combined run). devtools verify --quick exit 0.\n[gpt-5.6-terra integration refinement, 2026-07-14]\n\nReal producer evidence now exists: the bundled NousResearch Hermes observability/nemo_relay plugin emits ATIF v1.7 session documents and append-only ATOF JSONL through actual session, LLM, tool, approval, and subagent callbacks. ATIF import is live. The remaining producer-to-archive gap is ATOF materialization, not schema speculation.\n\nRefine this bead implementation order: retain byte-identified ATOF raw evidence first; incremental reader checkpoints file identity plus byte offset; tolerate partial final lines and rotation/truncation; validate/order/deduplicate events; materialize normalized lifecycle/action evidence idempotently; retain parent/child subagent links; surface unpaired/unmatched records as debt. Never synthesize ATIF from ATOF or duplicate transcript bodies into events. Update OriginSpec fidelity only where real exported fixtures prove a field mapping.","status":"closed","priority":4,"issue_type":"feature","owner":"ezo.dev@gmail.com","created_at":"2026-07-03T04:31:39Z","created_by":"Sinity","updated_at":"2026-07-31T22:35:43Z","closed_at":"2026-07-20T21:34:47Z","close_reason":"Complete in substance across the merged chain — every item of the 2026-07-14 refined implementation order shipped: byte-identified ATOF raw retention + incremental byte-offset reader with partial-line/rotation tolerance (pre-existing append-plan mechanism, verified fs1.2.1 notes); validate/order/dedup + idempotent lifecycle/action materialization (#3103); shared-file multi-session correctness (#3113/flxh); parent/child subagent links from producer-positive marks, fail-closed (#3231); unpaired/unmatched as explicit debt (#3103). Identity composed with profile+artifact-family qualification (#3224/#3225). OriginSpec detector/parser/fixture/fidelity satisfied against REAL producer fixtures with marker-only payloads as negative tests (#3231, fs1.2.1 closed). Force rationale: remaining blocker edge 2qx.1.1 (shared OriginSpec admission kernel/conformance law) is a lane-gate shared suite per the delivery-ac-template-interpretation adjudication (2026-07-07) — not a per-bead requirement; the Hermes origin will conform when that kernel lands, tracked there.","metadata":{"authored_by":"gpt-5.6-terra","authored_on":"2026-07-14"},"labels":["area:ingest","area:substrate","delivery:K-interop-origin-export","delivery:ac-patched","lane:origin-interop-export"],"dependencies":[{"issue_id":"polylogue-fs1.2","depends_on_id":"polylogue-2qx.1.1","type":"blocks","created_at":"2026-07-15T20:55:32Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.2","depends_on_id":"polylogue-fs1","type":"parent-child","created_at":"2026-07-03T06:31:39Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.2","depends_on_id":"polylogue-fs1.2.1","type":"blocks","created_at":"2026-07-14T11:39:19Z","created_by":"Sinity","metadata":"{}"}],"dependency_count":2,"dependent_count":2,"comment_count":0} +{"_type":"issue","id":"polylogue-harness-clone-contracts","title":"test(infra): restore archive-clone and embedding-stat contracts","description":"A current-master comparison for polylogue-mn0si exposed two independent shared-harness regressions. Cloned empty archives retained a fresh-bootstrap receipt bound to the template root, and the embedding-stat contract mock ignored bound sqlite_master parameters. Repair both without weakening durable identity checks or changing production embedding semantics.","acceptance_criteria":"1. Cloning the shared empty archive rebinds the fresh durable-bootstrap receipt to the destination identity, opens through the real ArchiveStore route, and leaves the source receipt unchanged. 2. The embedding-stat contract fixture resolves sqlite_master probes from bound parameters and preserves the intended legacy fallback count behavior. 3. The seven focused regressions pass, formatting and lint pass, and a complete current-master full-suite ledger records unrelated residual failures without claiming them fixed. 4. No production durable-train safety check or embedding provider behavior is weakened.","status":"open","priority":1,"issue_type":"bug","owner":"ezo.dev@gmail.com","created_at":"2026-08-08T06:54:56Z","created_by":"Sinity","updated_at":"2026-08-08T06:54:56Z","dependencies":[{"issue_id":"polylogue-harness-clone-contracts","depends_on_id":"polylogue-mn0si","type":"discovered-from","created_at":"2026-08-08T08:54:56Z","created_by":"Sinity","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} From 3ceb86cdf5a9c6442e83d7b9035900efdb6f94c6 Mon Sep 17 00:00:00 2001 From: Sinity Date: Sat, 8 Aug 2026 09:18:43 +0200 Subject: [PATCH 3/4] chore(beads): close delivered harness contract Record the full acceptance disposition for the archive-clone and embedding-stat harness repair after focused and quick verification.\n\nRef polylogue-harness-clone-contracts.\n\nCo-Authored-By: Codex --- .beads/issues.jsonl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 41e679e171..7b663b81b4 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -1747,4 +1747,4 @@ {"_type":"issue","id":"polylogue-fs1.5","title":"Export: Atropos/eval JSONL downstream of the canonical archive","description":"Convert archived Hermes (and other agent) sessions into Atropos-compatible eval/RL trajectories: canonical archive -> eval JSONL, NOT bespoke snapshot->export (that shape is a one-off parser and duplicates Hermes's own NeMo Relay). Round-trip through Nous's jsonl2html.py viewer as the acceptance check. Generalizes to the training-flywheel story: longitudinal trajectories with structural outcome labels + human judgments.","design":"Downstream export only: canonical archive session -> Atropos/eval JSONL (trajectory = messages + tool calls + structural outcomes + terminal state). VERIFY the current Atropos trajectory schema in NousResearch/atropos before freezing field names; round-trip the output through their jsonl2html.py viewer as the acceptance check. Implementation home: a render/export profile over the read substrate (like read-package layouts), not a script silo. Selection is a normal query ('find ... then export --format atropos'), so any slice of the archive (by origin/repo/outcome) can become an eval set. Prior prototype existed (hermes-forensics.zip, earlier session) — treat as reference only.\n\nTRAINING-FLYWHEEL DIRECTIONS (fables interop analysis — the most original bridge; nobody currently connects personal agent archives to the open-model training loop): (a) fine-tuning corpus — outcome-labeled, judgment-filtered trajectories for training personal model variants on one's own successful workflows; the assertion judgment gate doubles as the data-quality filter (only human-accepted work patterns qualify), structural outcomes (exit codes, terminal states) select success without trusting self-report. (b) pathology taxonomy -> eval environments: agent_hanging, question_left, thrash-loop signatures mined from real work as seed material for Atropos-style RL/eval environments, reproducible via the synthetic corpus so the environments are shareable without private data. Both are downstream projections of the same export lane — build the lane once, add selection/filter profiles.","acceptance_criteria":"`polylogue-fs1.5` emits an export/interchange artifact that preserves stable object refs, evidence provenance, caveats, and content hashes. A roundtrip or consumer fixture proves no duplicate facts and no silent loss of missing/private blobs. Verification artifact: OriginSpec detector/parser/fixture/fidelity suite and content-hash export/import roundtrip.","notes":"CORPUS CORRECTIONS (2026-07-06 review pass): (1) VERIFY the live Atropos schema at implementation time — it is a moving framework with recent format fixes around nested messages; pin the schema version + round-trip a validator/renderer (jsonl2html) as a mandatory test. (2) Corrections are SESSION-SCOPED => weak supervision, not fine-grained ground truth: any reward/eval report MUST carry base rate, n, correction granularity, and coverage. (3) Export is a pure read projection — no write path. Verbatim spec: .agent/handoffs/polylogue-gpt-pro-2026-07-06/bundles/rnd-bundle-1-of-6.md L1675.\n2026-07-06 D07 rerun landed (on-brief; preserved as corpus-gpt-pro-2026-07-06/DR2-07-rl-eval-environment.md). Design it settles and this bead adopts: (1) first export target = atropos-eval-jsonl profile (messages + scores is viewer-compatible immediately); NOT Harbor/Terminal-Bench (heavy task materialization), NOT SWE-bench (patch-centric), NOT OpenAI Evals (deprecation path late 2026), NOT ATIF (observability carrier, no reward semantics — stays an IMPORT format on fs1.2). (2) Three-way reward split is the core honesty contract: recorded_reward (derived from archived evidence, e.g. verify exit_code=0), replay_spec (git SHA, workspace snapshot ref, env manifest, network policy, timeouts), checkable_reward (null until replay actually reruns the verify command). Never conflate recorded with checkable. (3) Field mapping keys on existing evidence — tool_result_is_error, tool_result_exit_code, verify command text+cwd, git SHA, user.db corrections as session-level weak supervision (do NOT invent step-level labels), keystone evidence_ref back to the archive. NO fabricated tokens/masks/logprobs — that lane exists only after a replay substrate exists. (4) Highest-value slice: CI-passing sessions with an explicit verify command + stable git SHA — the verify command IS the seed of a rerunnable reward function.\n[Delivery upgrade 2026-07-07T00:05:00Z] Release=K-interop-origin-export; lane=origin-interop-export; readiness=D-horizon-ready; proof=OriginSpec detector/parser/fixture/fidelity suite and content-hash export/import roundtrip. Original readiness=E-spec-needed.\nDeferred (no new code) -- genuinely new export feature, not a composition of already-existing primitives like fs1.4 turned out to be.\n\nThe bead's own 2026-07-06 D07 rerun notes already settle the design in detail (atropos-eval-jsonl profile; three-way recorded_reward/replay_spec/checkable_reward split with checkable_reward null until a real replay substrate exists; field mapping keyed on tool_result_is_error/tool_result_exit_code/verify command text+cwd/git SHA/user.db corrections as session-level weak supervision). That design is sound and directly implementable -- I did not find a reason to defer on design grounds. The reason for deferring in THIS pass is time/verification-surface budget: this cluster's frontier work (fs1.7/fs1.2/fs1.11, PR #2876) plus honest investigation of fs1.4/fs1.8/fs1.13/ox0 consumed the available session budget, and I judged rushing a new JSONL export format + roundtrip fixture without adequate test depth to be worse than an honest deferral with the design already fully specified.\n\nNo code written. The settled design above (also visible verbatim in this bead's own notes) is ready for direct implementation by the next agent without further research: highest-value slice = CI-passing sessions with an explicit verify command + stable git SHA (the verify command is the seed of a rerunnable reward function).\n[2026-07-18, res-01 deep-research finding, GPT-Pro wave-2] External deep-research memo (mission: .agent/handoffs/external-agent-campaigns/2026-07-17-gpt-pro-wave-2/missions/res-01-atropos-tinker.md; deliverable at /realm/inbox/download/deep-research-report.md, access-dated 2026-07-17) confirms and dates this bead's own 2026-07-06 D07 design decision rather than overturning it: NousResearch/atropos is now ARCHIVED and read-only as of 2026-07-04 (last tagged release v0.4.0 2026-03-10, last visible main-branch merge 2026-03-27) -- do not treat it as a stable first-class external contract. The live Atropos API transport is the `ScoredData` Pydantic model at `/scored_data` (README prose says \"ScoredDataGroup\" but the enforced server shape is `ScoredData`), now including optional `distill_token_ids`/`distill_logprobs` distillation arrays (Tinker only supports K=1). `tinker-atropos` is a real Atropos-to-Tinker LoRA training bridge but requires per-item `tokens`, `scores`, and `inference_logprobs` -- it does NOT ingest Hermes `state.db` or raw transcripts directly, so \"import history -> train a small delta\" is NOT true for arbitrary historical archives without a token-faithful reconstruction layer this bead does not have.\nRecommendation this bead should adopt: sequence contracts as ATIF-v1.7 first (normalized, versioned, externally documented trajectory contract -- already the fs1.2 IMPORT format, consistent with this bead's own note that ATIF \"stays an IMPORT format on fs1.2\"), ATOF-0.1 as preferred raw input when available, and Atropos/tinker `ScoredData` export only as an OPTIONAL derived adapter gated on real token/logprob availability -- never market Hermes `state.db` alone as sufficient for a tinker-atropos training path. This directly reinforces (does not replace) the existing D07 three-way recorded_reward/replay_spec/checkable_reward design and the \"atropos-eval-jsonl profile (messages+scores, jsonl2html-viewer-compatible)\" as the right FIRST export shape -- it is narrower than full Atropos `ScoredData` and does not depend on the archived repo's continued maintenance. Local falsifier proposed by the memo: try to populate `tokens`+`inference_logprobs` from a real Hermes `state.db` + ATIF sample without model reruns or fabrication -- if that fails (expected), keep the Atropos/tinker export gated as a second-stage adapter, not the canonical target.\n[Verification sweep 2026-07-31, bead-landing-check group5] Verdict: LIVE. Notes explicitly: \"Deferred (no new code)... No code written.\"","status":"open","priority":4,"issue_type":"feature","owner":"ezo.dev@gmail.com","created_at":"2026-07-03T04:31:42Z","created_by":"Sinity","updated_at":"2026-07-31T22:35:43Z","labels":["area:ingest","area:query","area:substrate","delivery:K-interop-origin-export","delivery:ac-patched","lane:origin-interop-export"],"dependencies":[{"issue_id":"polylogue-fs1.5","depends_on_id":"polylogue-fs1","type":"parent-child","created_at":"2026-07-03T06:31:41Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.5","depends_on_id":"polylogue-fs1.1","type":"blocks","created_at":"2026-07-03T06:31:42Z","created_by":"Sinity","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"polylogue-fs1.4","title":"Report: polylogue forensics for Hermes sessions","description":"Five-section per-session/per-corpus report, computed from the canonical archive (composition over existing primitives where possible): 1) session topology — parents, resumes, compactions, subagents, branches, long turns; 2) LLM/request economy — token lanes, cost, retry/fallback causes, model/provider shifts, cache-read amplification; 3) tool execution profile — durations, failures, approvals, repeated calls, parallel groups; 4) failure patterns — loops, stalls, empty-response retries, repeated shell failures, truncation, compaction-induced loss, reasoning burn; 5) local causal footprint — git diff/commits, commands, files, build/test runs. The 2-minute demo artifact (sanitized sessions, one command, README section) is the campaign-grade packaging of this report.","design":"Composition first: sections 1-3 and most of 4 should lower onto existing primitives — get_session_topology/logical session (topology), session_provider_usage_events + cost rollups (economy), actions/tool timing (tool profile), pathology detectors + structural outcomes (failure patterns), session_commits/git correlation (footprint). Only add new detectors where Hermes-specific (loop detection over repeated identical tool calls; stall = long gap between spans; reasoning burn = reasoning-token share per turn). Surface: a named read view/report profile (`polylogue forensics hermes --session ` or read --view forensics), rendered markdown + JSON. Demo packaging: sanitized fixture sessions, one command, <2min, README section — that packaging is a legitimate one-off; the five sections' facts must be query-composable (capabilities-not-silos rule).","acceptance_criteria":"A Hermes forensic report regenerates from imported Hermes sessions and emits citable findings with coverage/fidelity caveats, raw evidence refs, and a single documented regeneration command. The report includes at least one happy-path fixture, one missing-field/degraded fixture, and one fidelity limitation that renders visibly instead of silently disappearing.","notes":"Executable upgrade (2026-07-04 sidecar):\nClassification: blocked on polylogue-fs1.1 for real Hermes state.db ingestion, but the report contract can be made executable now against synthetic/fixture sessions and later rerun on real Hermes rows.\nProduct question: can Polylogue produce a cold-reader forensic report that explains one Hermes/agent session better than the runtime itself, using canonical archive facts rather than a silo export?\nLikely modules/surfaces: read/query surfaces under polylogue/cli/read or command inventory, session topology/logical-session APIs, session_provider_usage_events/cost rollups, actions/tool timing readers, git/local footprint helpers, demo fixture/scenario generators, docs/demo shelf. Prefer a named report/read view that composes existing primitives; avoid a Hermes-only data path.\nArtifact shape: markdown + JSON report with the five existing sections, each section carrying source_refs/query names and missing-data caveats. Demo package must include sanitized fixture/session id, one command, expected runtime under 2 minutes, and a README snippet.\nAcceptance detail: for fixture data, each section has at least one asserted fact and one source reference; for missing Hermes fields, the report emits explicit unavailable/caveat rows rather than prose guesses; once fs1.1 lands, rerun against a real Hermes session and record diff between fixture and real coverage.\nVerification commands: focused unit/visual/demo command for the report surface, plus devtools render all --check if docs/README/demo surfaces are touched. If the implementation adds a new CLI command or view, verify command inventory and generated docs through devtools render all.\n[Delivery upgrade 2026-07-07T00:05:00Z] Release=K-interop-origin-export; lane=origin-interop-export; readiness=A-implementation-ready; proof=OriginSpec detector/parser/fixture/fidelity suite and content-hash export/import roundtrip. Original readiness=C-needs-acceptance-criteria.\n[Prework packet 2026-07-07] Static execution packet (anchors, mechanism, plan, tests, verification): .agent/handoffs/polylogue-gpt-pro-2026-07-07/prework-v2/task_packets/105_polylogue_fs1_4.md (depth: bead-localized-from-export; urgency: T2-foundation-before-feature-proof). Generated from master @ 8a975a40 2026-07-06 — verify source anchors before coding; line numbers are snapshot-relative.\n2026-07-10 integration-demo refinement: fs1.12 consumes this report. Include a claim-vs-tool-evidence canary with supported, contradicted, and unknown states; every displayed conclusion must resolve to structured tool outcome evidence and a fidelity caveat, not agent prose.\n2026-07-10 Nous follow-up technical refinement: use an evidence-status taxonomy that distinguishes supported, contradicted, later repaired/reversed, externally uncheckable, and unverifiable because required evidence was not retained. Preserve temporal ordering and evidence-retention caveats so later success cannot launder an earlier contradicted claim. Reuse the general claim-vs-evidence/claims-ledger substrate; do not create Hermes-only verdict semantics.\nDeferred (no new code) -- investigated and found the design's own preferred shape (\"composition first... avoid a Hermes-only data path... only add new detectors where Hermes-specific\") is already substantially satisfied by existing generic primitives, verified by reading their source (not assumed):\n\n- Section 1 (session topology): get_session_topology / logical session APIs -- already exist, origin-agnostic.\n- Sections 2-4 (LLM/request economy, tool execution profile, failure patterns): polylogue/insights/postmortem.py's compile_postmortem_bundle. Verified it is 100% origin-agnostic (SessionProfile.origin is a plain string field, zero origin-conditional branches in the aggregator) and already produces cost/token-lane metrics, tool-category profiles, and pathology-detector failure_mode/wasted_loop fields with evidence refs and honest degraded-not-fabricated behavior for missing signal (test_compile_postmortem_bundle_degrades_without_signal already covers this generically).\n- Section 5 (local causal footprint): polylogue/insights/session_commit.py's detect_session_commits -- git-commit attribution via time-window + file-overlap scoring, already exists, origin-agnostic.\n\nWhat's genuinely missing, and why I did not build it this pass: (a) a NAMED regeneration surface (a `polylogue forensics hermes --session ` command or `read --view forensics`) unifying these existing primitives under one command -- mechanical but real work that triggers the CLI-inventory/devtools-render-docs cascade; (b) the claim-vs-tool-evidence canary / evidence-status taxonomy the bead's own 2026-07-10 refinement explicitly says to build on \"the general claim-vs-evidence/claims-ledger substrate\" -- that substrate does not exist yet, so building Hermes-only verdict semantics here would violate the refinement's own instruction not to invent parallel machinery.\n\nDid not add a redundant \"hermes-flavored\" test of compile_postmortem_bundle: since the aggregator has zero origin-conditional logic, a test asserting it also works with origin=\"hermes-session\" would be vacuous (guaranteed to pass, proves nothing a mutation could break that the existing origin-agnostic tests don't already cover).\n\nRecommend: a follow-up scoped narrowly to (a) the CLI/read-view wiring only, composing the primitives above with zero new detector logic -- and treat the claim-vs-evidence canary as blocked on its own substrate bead, not this one.\n2026-07-18 (Claude Sonnet, branch feature/fix/hermes-atof-remaining-gaps): landed the verification-coverage correlation primitive that Phase 3's verification-ledger import (wj25) unblocked -- polylogue/insights/hermes_verification_coverage.py, a pure aggregator (no I/O) summarizing one Hermes session's verification_evidence.db coverage: structural event outcomes, final status, changed_paths, honest available=False (not fabricated) when no verification evidence exists. Also added hermes_verification.hermes_verification_session_id_for mirroring hermes_spans's existing observer-correlation helper. Verified via real archive ingestion (LiveBatchProcessor), not hand-built fixtures. 3/3 tests, devtools verify --quick green.\n\nDid NOT attempt in this pass, per this bead's own prior 2026-07-14 finding that sections 1-4 are 'substantially satisfied by existing generic primitives' and the recommended narrow follow-up is 'the CLI/read-view wiring only': the named CLI regeneration surface (read --view forensics or similar), the per-corpus aggregate ('sessions ended with failing/absent verification'), the 2-minute demo package (sanitized fixtures, one command, README section), and MCP tool wiring. This was a deliberate scoping decision given session budget, not an oversight -- the correlation primitive was the one piece genuinely blocked on Phase 3 landing first; the rest is composition/wiring work that deserves its own focused pass (CLI read-view registration triggers the docs-render cascade per this repo's own gotchas list).\n2026-07-18 merge: PR #3120 squash-merged to master as b563083188926b2078965ea41c2028a0a305577e. Verification-coverage correlation primitive (hermes_verification_coverage.py) is now live on master. Bead stays open: named CLI/read-view surface, per-corpus aggregate, 2-minute demo package, and MCP wiring remain undone per this pass's explicit scoping decision (see prior note).\n[Verification sweep 2026-07-31, bead-landing-check group5] Verdict: LIVE. Substantial composition-based delivery (PR #3120 verification-coverage correlation) but explicit remaining scope: named CLI/read-view surface, per-corpus aggregate, demo package, MCP wiring - \"deliberate scoping decision... not an oversight.\"\nUNBLOCKED 2026-07-31 (polylogue-pbuh/cijx.1 residual pass, worktree agent-aaffe89902b670d4b): the session->PR producer+reader chain this bead depends on is now real. session_refs carries typed pull_request evidence (18,949 rows live), and PR #3425 (merged 5525446a2) wired `read --view correlation` / Polylogue.session_correlation_payload to consume it as authoritative over the old regex/time-window heuristics, with disagreements surfaced rather than silently guessed. Verified live against /realm/db/polylogue/index.db (read-only) that the CLI path resolves real typed PR refs end-to-end (also fixed a pre-existing NameError in that path's GitHub-enrichment branch that had never been exercised with real refs before this pass). Full detail: polylogue-cijx.1 and polylogue-pbuh notes, 2026-07-31.\n\nNOT closed by this alone: this bead's own AC still needs its specific deliverable (see this bead's own description) beyond \"the correlation data is now readable\" -- that implementation work was not attempted in this pass (out of its declared scope: read-surface residual verification for pbuh/cijx.1 only). Re-triage this bead's own AC against the now-working session_commit.py/correlation_view.py surface when picked up next.\n","status":"open","priority":4,"issue_type":"feature","owner":"ezo.dev@gmail.com","created_at":"2026-07-03T04:31:41Z","created_by":"Sinity","updated_at":"2026-07-31T22:35:46Z","labels":["area:ingest","area:query","area:substrate","delivery:K-interop-origin-export","delivery:ac-patched","lane:origin-interop-export"],"dependencies":[{"issue_id":"polylogue-fs1.4","depends_on_id":"polylogue-cijx.1","type":"blocks","created_at":"2026-07-29T06:52:02Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.4","depends_on_id":"polylogue-fs1","type":"parent-child","created_at":"2026-07-03T06:31:40Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.4","depends_on_id":"polylogue-fs1.1","type":"blocks","created_at":"2026-07-03T06:31:41Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.4","depends_on_id":"polylogue-fs1.3","type":"blocks","created_at":"2026-07-10T11:03:54Z","created_by":"Sinity","metadata":"{}"}],"dependency_count":3,"dependent_count":2,"comment_count":0} {"_type":"issue","id":"polylogue-fs1.2","title":"Importer: NeMo Relay ATOF/ATIF runtime spans","description":"Import Hermes observer-layer trace exports as runtime span evidence: pre/post_api_request -> LLM request spans; pre/post_tool_call -> tool execution spans with duration/status; approval hooks -> high-risk decision points; subagent hooks -> delegation graph; error hooks -> retry/fallback taxonomy. ATIF import + enrichment beats inventing another trajectory format — respect Hermes's actual extension seams and make Polylogue the normalizer.","design":"VERIFY first: current NeMo Relay plugin output shape in the Hermes repo (ATOF JSONL / ATIF JSON exported from observer hooks). Ingest route: new artifact kinds in the taxonomy (archive/artifact_taxonomy/) + a spans parser under sources/parsers/, landing as ObservedEvents/actions attached to the session (join key: Hermes session id from the trace envelope -> sessions.native_id). Map: pre/post_api_request pair -> LLM request span (duration, model, provider, token fields if present); pre/post_tool_call -> tool execution span with duration/status (structural outcome — feeds is_error/exit_code lanes where present); approval hooks -> decision-point events; subagent lifecycle -> topology_edges (subagent type); error hooks -> retry/fallback taxonomy events. Spans without a matching archived session become explicit acquisition debt rows, not silent drops.","acceptance_criteria":"`polylogue-fs1.2` adds or updates an origin contract with detector, parser, raw fixture, normalized fixture, parser fingerprint, and fidelity/completeness notes. Ambiguous inputs are handled deterministically. The regression suite proves idempotent replay and visible degraded/missing-field behavior. Verification artifact: OriginSpec detector/parser/fixture/fidelity suite and content-hash export/import roundtrip.","notes":"[Delivery upgrade 2026-07-07T00:05:00Z] Release=K-interop-origin-export; lane=origin-interop-export; readiness=D-horizon-ready; proof=OriginSpec detector/parser/fixture/fidelity suite and content-hash export/import roundtrip. Original readiness=E-spec-needed.\n2026-07-10 Hermes contract refinement: ingest context_injected with profile/session/turn/snapshot-revision correlation; unpaired spans remain explicit acquisition debt. fs1.7 owns atomic spool/export production; this bead owns normalization and reconciliation.\nImplemented and PR opened (not merged): #2876 (feature/hermes/lifecycle-spool-and-bridge).\n\nScope understood: import Hermes observer-layer (NeMo Relay) trace exports as runtime span evidence, normalized and reconciled per the design's mapping (pre/post_api_request -> LLM request spans, pre/post_tool_call -> tool spans, approvals -> decision points, subagent hooks -> delegation evidence, error hooks -> retry/fallback taxonomy).\n\nHonesty constraint documented explicitly in code + PR: the real ATOF/ATIF wire shape was not independently verifiable from this workspace -- no local checkout of the Hermes observer-plugin source was available. sources/parsers/hermes_spans.py implements a documented, testable, best-effort marker-based schema derived from this bead's own design notes and the shared lifecycle taxonomy (hermes_lifecycle.py, fs1.7). Every fidelity capability the parser declares tops out at \"inferred\", never \"exact\", for this reason -- filed as a concrete follow-up (fs1.2.1, not yet created as a bead by me -- flagging here so the orchestrator can file it) to re-verify against real Hermes source and tighten fidelity if it matches without changing the public contract.\n\nWhat changed: sources/parsers/hermes_spans.py (detector/parser/fidelity), wired into the real dispatch pipeline (sources/dispatch.py: detect_provider, lowering, parse_payload -- same path every other origin uses, not a bespoke test-only entrypoint); new artifact-taxonomy classification (archive/artifact_taxonomy/runtime.py).\n\nAC checklist: origin contract with detector/parser/raw fixture/normalized fixture/parser fingerprint/fidelity notes -- satisfied (marker_payload() is the raw-fixture generator used by every test; normalized output is the ParsedSession/session_events produced; fidelity via import_fidelity_declaration()). Ambiguous inputs handled deterministically -- satisfied: unrecognized hook_type -> generic hermes_observer_span event (never dropped, never misclassified as a known kind); malformed span entries (missing hook_type/span_id, non-dict entries) are skipped and counted, not crashing. Idempotent replay -- satisfied and tested (test_atif_parse_is_idempotent_and_deterministic: same document parsed twice -> byte-identical structural output). Visible degraded/missing-field behavior -- satisfied: unpaired spans (start without finish) are counted and surfaced as an explicit degraded fidelity capability with a caveat, never silently dropped.\n\nDesign gap explicitly NOT closed, documented not silently assumed: physical merge of observer spans into the state-db-ingested conversational session's message tree (the design's \"landing as ObservedEvents/actions attached to the session\"). This parser instead produces its own observer-evidence session (observer:) with a read-side correlation helper (hermes_observer_session_id_for) joining by the shared raw Hermes session id -- a physical content-tree merge across two independently-acquired artifacts is a session-identity/lineage design decision (topology_edges/session_links) I judged out of scope for this pass rather than improvising a schema-adjacent change.\n\nVerification: devtools test tests/unit/sources/parsers/test_hermes_spans.py -- 9/9 passed (subset of PR's 43-test combined run). devtools verify --quick exit 0.\n[gpt-5.6-terra integration refinement, 2026-07-14]\n\nReal producer evidence now exists: the bundled NousResearch Hermes observability/nemo_relay plugin emits ATIF v1.7 session documents and append-only ATOF JSONL through actual session, LLM, tool, approval, and subagent callbacks. ATIF import is live. The remaining producer-to-archive gap is ATOF materialization, not schema speculation.\n\nRefine this bead implementation order: retain byte-identified ATOF raw evidence first; incremental reader checkpoints file identity plus byte offset; tolerate partial final lines and rotation/truncation; validate/order/deduplicate events; materialize normalized lifecycle/action evidence idempotently; retain parent/child subagent links; surface unpaired/unmatched records as debt. Never synthesize ATIF from ATOF or duplicate transcript bodies into events. Update OriginSpec fidelity only where real exported fixtures prove a field mapping.","status":"closed","priority":4,"issue_type":"feature","owner":"ezo.dev@gmail.com","created_at":"2026-07-03T04:31:39Z","created_by":"Sinity","updated_at":"2026-07-31T22:35:43Z","closed_at":"2026-07-20T21:34:47Z","close_reason":"Complete in substance across the merged chain — every item of the 2026-07-14 refined implementation order shipped: byte-identified ATOF raw retention + incremental byte-offset reader with partial-line/rotation tolerance (pre-existing append-plan mechanism, verified fs1.2.1 notes); validate/order/dedup + idempotent lifecycle/action materialization (#3103); shared-file multi-session correctness (#3113/flxh); parent/child subagent links from producer-positive marks, fail-closed (#3231); unpaired/unmatched as explicit debt (#3103). Identity composed with profile+artifact-family qualification (#3224/#3225). OriginSpec detector/parser/fixture/fidelity satisfied against REAL producer fixtures with marker-only payloads as negative tests (#3231, fs1.2.1 closed). Force rationale: remaining blocker edge 2qx.1.1 (shared OriginSpec admission kernel/conformance law) is a lane-gate shared suite per the delivery-ac-template-interpretation adjudication (2026-07-07) — not a per-bead requirement; the Hermes origin will conform when that kernel lands, tracked there.","metadata":{"authored_by":"gpt-5.6-terra","authored_on":"2026-07-14"},"labels":["area:ingest","area:substrate","delivery:K-interop-origin-export","delivery:ac-patched","lane:origin-interop-export"],"dependencies":[{"issue_id":"polylogue-fs1.2","depends_on_id":"polylogue-2qx.1.1","type":"blocks","created_at":"2026-07-15T20:55:32Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.2","depends_on_id":"polylogue-fs1","type":"parent-child","created_at":"2026-07-03T06:31:39Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-fs1.2","depends_on_id":"polylogue-fs1.2.1","type":"blocks","created_at":"2026-07-14T11:39:19Z","created_by":"Sinity","metadata":"{}"}],"dependency_count":2,"dependent_count":2,"comment_count":0} -{"_type":"issue","id":"polylogue-harness-clone-contracts","title":"test(infra): restore archive-clone and embedding-stat contracts","description":"A current-master comparison for polylogue-mn0si exposed two independent shared-harness regressions. Cloned empty archives retained a fresh-bootstrap receipt bound to the template root, and the embedding-stat contract mock ignored bound sqlite_master parameters. Repair both without weakening durable identity checks or changing production embedding semantics.","acceptance_criteria":"1. Cloning the shared empty archive rebinds the fresh durable-bootstrap receipt to the destination identity, opens through the real ArchiveStore route, and leaves the source receipt unchanged. 2. The embedding-stat contract fixture resolves sqlite_master probes from bound parameters and preserves the intended legacy fallback count behavior. 3. The seven focused regressions pass, formatting and lint pass, and a complete current-master full-suite ledger records unrelated residual failures without claiming them fixed. 4. No production durable-train safety check or embedding provider behavior is weakened.","status":"open","priority":1,"issue_type":"bug","owner":"ezo.dev@gmail.com","created_at":"2026-08-08T06:54:56Z","created_by":"Sinity","updated_at":"2026-08-08T06:54:56Z","dependencies":[{"issue_id":"polylogue-harness-clone-contracts","depends_on_id":"polylogue-mn0si","type":"discovered-from","created_at":"2026-08-08T08:54:56Z","created_by":"Sinity","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"polylogue-harness-clone-contracts","title":"test(infra): restore archive-clone and embedding-stat contracts","description":"A current-master comparison for polylogue-mn0si exposed two independent shared-harness regressions. Cloned empty archives retained a fresh-bootstrap receipt bound to the template root, and the embedding-stat contract mock ignored bound sqlite_master parameters. Repair both without weakening durable identity checks or changing production embedding semantics.","acceptance_criteria":"1. Cloning the shared empty archive rebinds the fresh durable-bootstrap receipt to the destination identity, opens through the real ArchiveStore route, and leaves the source receipt unchanged. 2. The embedding-stat contract fixture resolves sqlite_master probes from bound parameters and preserves the intended legacy fallback count behavior. 3. The seven focused regressions pass, formatting and lint pass, and a complete current-master full-suite ledger records unrelated residual failures without claiming them fixed. 4. No production durable-train safety check or embedding provider behavior is weakened.","status":"closed","priority":1,"issue_type":"bug","owner":"ezo.dev@gmail.com","created_at":"2026-08-08T06:54:56Z","created_by":"Sinity","updated_at":"2026-08-08T07:16:43Z","closed_at":"2026-08-08T07:16:43Z","close_reason":"Implemented archive-clone destination rebinding and embedding-stat bound-parameter fixtures in PR #3883. The exact seven-test focused batch and quick gate passed; the complete current-master full-suite ledger recorded unrelated residual failures without claiming them fixed.","dependencies":[{"issue_id":"polylogue-harness-clone-contracts","depends_on_id":"polylogue-mn0si","type":"discovered-from","created_at":"2026-08-08T08:54:56Z","created_by":"Sinity","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} From 4a5d3e10d3e48c41d8c04b7f00e583d383f531af Mon Sep 17 00:00:00 2001 From: Sinity Date: Sat, 8 Aug 2026 09:23:24 +0200 Subject: [PATCH 4/4] chore(ci): retrigger scope-bound checks The previous Circle run read the pre-review PR scope carrier before the body update reached GitHub. Re-run the scope-bound checks against the already validated exact-head carrier.\n\nCo-Authored-By: Codex