Skip to content

feat: bound archive continuity reads - #3049

Closed
Sinity wants to merge 13 commits into
masterfrom
feature/query/z9gh-closure
Closed

Sinity wants to merge 13 commits into
masterfrom
feature/query/z9gh-closure

Conversation

@Sinity

@Sinity Sinity commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Establishes the current z9gh foundation: bounded query transactions, selective action paging, fail-closed raw-authority replay/scale proofs, OriginSpec coverage, Claude Workflow artifact admission, provider-neutral work topology, and explicit claim/effect reconciliation primitives.

Problem

A live continuity query could either truncate needed evidence at the response boundary or materialize archive-wide action/delegation views under agent load. The archive lacked declared Workflow artifact coverage and a type-safe distinction between agent claims and independently observed effects.

Solution

  • Route terminal unit reads through one paged QueryTransaction across API, HTTP, and MCP.
  • Select ordinary action pages before deriving follow-up detail.
  • Serialize raw-authority frontier claims; make scale receipts reject incomplete/failed/deferred workloads.
  • Declare Claude Workflow artifacts in OriginSpec and project admitted facts into the generic work graph.
  • Add effect nodes and explicit reconciliation judgments without collapsing claims into repository truth.

Verification

  • — 84 passed.
  • — 86 passed.
  • — 19 passed.
  • — 4 passed.
  • — 4 passed.
  • {
    "timestamp": "2026-07-17T19:23:36.860943+00:00",
    "git_head": "9ddbf6ce4f6bcfce75d88e80c1ced38999eb4a50",
    "tier": "quick",
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa",
    "steps": [
    {
    "name": "ruff format",
    "duration_s": 0.01,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/01-ruff-format"
    },
    {
    "name": "ruff check",
    "duration_s": 0.01,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/02-ruff-check"
    },
    {
    "name": "mypy",
    "duration_s": 0.56,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/03-mypy"
    },
    {
    "name": "render all",
    "duration_s": 8.34,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/04-render-all"
    },
    {
    "name": "verify topology",
    "duration_s": 0.43,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/05-verify-topology"
    },
    {
    "name": "verify layering",
    "duration_s": 4.46,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/06-verify-layering"
    },
    {
    "name": "verify closure-matrix",
    "duration_s": 0.27,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/07-verify-closure-matrix"
    },
    {
    "name": "lab schema roundtrip",
    "duration_s": 1.14,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/08-lab-schema-roundtrip"
    },
    {
    "name": "verify manifests",
    "duration_s": 1.77,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/09-verify-manifests"
    },
    {
    "name": "verify ci-workflows",
    "duration_s": 0.31,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/10-verify-ci-workflows"
    },
    {
    "name": "verify doc-commands",
    "duration_s": 2.59,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/11-verify-doc-commands"
    },
    {
    "name": "verify docs-coverage",
    "duration_s": 2.57,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/12-verify-docs-coverage"
    },
    {
    "name": "verify test-infra-currency",
    "duration_s": 0.34,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/13-verify-test-infra-currency"
    },
    {
    "name": "verify test-clock-hygiene",
    "duration_s": 2.05,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/14-verify-test-clock-hygiene"
    },
    {
    "name": "verify pytest-timeout-overrides",
    "duration_s": 3.68,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/15-verify-pytest-timeout-overrides"
    },
    {
    "name": "verify degrade-loudly",
    "duration_s": 1.1,
    "exit": 0,
    "run_id": "20260717T192306Z-quick-2625747-d1a1a0aa",
    "artifact_dir": ".cache/verify/runs/20260717T192306Z-quick-2625747-d1a1a0aa/steps/16-verify-degrade-loudly"
    }
    ],
    "total_duration_s": 29.92,
    "exit_code": 0
    } — 16/16 steps passed on the pushed head.

Remaining z9gh scope

  • Wire complete git/GitHub/Beads/artifact/verification observations into the reconciliation substrate.
  • Materialize the seeded incident archive through the source-to-work-graph route.
  • Drive and record the real MCP continuity walk, cancellation/resource receipt, and cold-model proof.

Ref polylogue-z9gh.

Sinity and others added 13 commits July 17, 2026 20:03
Introduce stable actor, content-addressed execution-context, and explicit worker-profile references. Comparative judgments now consume the core identity values while preserving their stored string wire fields.

The focused identity route and repository quick gate pass.
Add typed public-origin admission declarations for Claude Code, ChatGPT, and reserved Grok exports. The registry validates lifecycle, fixture, coverage, provider-collision, and detector-tightness contracts against the current parser dispatch order.

Focused declaration/source tests and the repository quick gate pass.
Problem: automated assertion replay could read a candidate before an\noperator judgment and later overwrite the terminal result from another\nconnection. ArchiveStore also bypassed the shared SQLite connection profiles\nfor user-tier reads and writes.\n\nWhat changed: establish BEGIN IMMEDIATE before top-level assertion\npreserve/write and judgment decisions, retaining caller-owned commits and\nnested batch savepoints. Route user-tier ArchiveStore connections through the\ncanonical read/write factories and prove the interleaving, conflict, timeout,\nand rollback behavior against real SQLite connections.\n\nCo-Authored-By: Codex <[email protected]>
Problem: source admission covered only pilot origins, leaving most public\nOrigin tokens outside the typed declaration and detector-parity contract.\n\nWhat changed: register each public Origin with executable parser and fixture\nevidence or explicit reserved/fallback semantics. The registry now reports a\nmissing public origin and validates detector precedence across the full\nexecutable set.\n\nCo-Authored-By: Codex <[email protected]>
Problem: provider completeness maintained a separate nine-origin inventory,\nwhich could report green while omitting public Origins and their lifecycle.\n\nWhat changed: OriginSpec now owns completeness modes for every public Origin.\nThe report projects those modes, including explicit reserved and fallback\nstates, and the old hand-maintained inventory is removed.\n\nCo-Authored-By: Codex <[email protected]>
Repair diagnostics now report the max payload envelope that governed
planning and postflight decisions, so persisted metrics and operator-visible
details agree for custom resource limits.

Strengthen recovery coverage to exercise census finalization through the
production restart path after all selected outcomes were recorded.

Co-Authored-By: Codex <[email protected]>
Problem: Claude workflow evidence was treated as generic sidecars, leaving
run snapshots, journals, agent metadata, and adoption manifests outside
the declared source-admission path.

What changed: declare the artifact family on the Claude OriginSpec, classify
its paths through that declaration, parse fact-bearing sidecars during the
existing Claude assembly pass, and preserve coordinator Workflow invocations
as provider-evidenced events. Missing counterpart artifacts report coverage
gaps instead of becoming inferred links.

Compatibility/migration: reparse Claude sessions and re-inventory workflow
artifacts when the declared parser fingerprint changes.

Ref polylogue-2qx.2.

Co-Authored-By: Codex <[email protected]>
Add a rebuildable work-evidence graph with typed topology nodes,
evidence-backed edges, and bidirectional repository traversal. Claims are
represented as distinct graph nodes and cannot stand in for observed effects
or evaluated satisfaction.

The index tier moves to v39. It is declared semantic-reparse only: rebuild
the derived index after source adapters materialize their admitted facts.

Ref polylogue-1vpm.6.1.

Co-Authored-By: Codex <[email protected]>
Reserve the source-tier write transaction before checking a frontier preview claim, preventing concurrent applies from creating duplicate execution receipts.

Regression coverage proves governed memberships replay after an index reset, recovery rejects partial frontier postconditions, and readiness remains fail-closed behind durable authority blockers.

Co-Authored-By: Codex <[email protected]>
Problem: terminal unit reads still let the API and HTTP adapters mint\nseparate execution identities, while ordinary action pages built follow-up\ndetail before their page selection.\n\nWhat changed: route terminal unit reads through QueryTransaction across API,\nHTTP, and MCP; preserve the HTTP reader timeout; and derive action follow-up\ndetail only for the selected ordinary-action page. The registered MCP route\nnow proves discovery plus advancing action continuation.\n\nRef polylogue-z9gh.9.1.\n\nCo-authored-by: Codex <[email protected]>
Reject every unsuccessful receipt-bearing repair pass and refuse successful
receipts for incomplete generated or resource-deferred workloads. Complete the
necessary parser census before receipt-bearing replay, sample host admission
around generation, census, and replay, and stream corpus identity metadata.

Set the command defaults to the July topology: 10,163 authority components,
15,264 direct candidates, and 21,398 expanded memberships.

Ref polylogue-z9gh.

Co-Authored-By: Codex <[email protected]>
Project only admitted coordinator and workflow artifact facts into the provider-neutral work graph. Preserve invocation, resume, call, attempt, structured-result, artifact, and unresolved identities without inferring membership from child-session topology.

Ref polylogue-2qx.2 and polylogue-1vpm.6.1.

Co-Authored-By: Codex <[email protected]>
Attach direct git, GitHub, Beads, artifact, and verification observations as effect nodes. Reconciliation judgments retain claims and effects as distinct facts and reject non-claim sources.

Ref polylogue-1vpm.6.2.

Co-Authored-By: Codex <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9a009112-c312-4baa-a152-aaa2d43a2a1a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/query/z9gh-closure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Sinity

Sinity commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

Closing the incomplete checkpoint rather than keeping a non-mergeable draft. The branch and commits remain available while the remaining operational proof and reconciliation work is completed.

@Sinity Sinity closed this Jul 17, 2026
@Sinity
Sinity deleted the feature/query/z9gh-closure branch July 17, 2026 19:51
Sinity added a commit that referenced this pull request Jul 27, 2026
## Summary

Implements the GitHub half of polylogue-z9gh's remaining gap #1
("production git/GitHub/Beads effect adapters"). Git and Beads effect
adapters were already production-real as of the #3049 checkpoint;
`GitHubPullRequestEffectAdapter` was a typed stub whose `collect()`
always
raised `EffectAdapterUnavailableError`. It now shells out to the `gh`
CLI to
read real PR lifecycle state.

## Problem

`polylogue-z9gh`'s notes explicitly mark the bead NOT TERMINAL, naming
three
remaining gaps. Gap #1 ("production git/GitHub/Beads effect adapters")
was
only two-thirds real: `reconcile_work_effects` had a working
`GitCommitEffectAdapter` (real `git log`) and `BeadsIssueEffectAdapter`
(real
`.beads/interactions.jsonl` parse), but the GitHub adapter was a
declared
placeholder that could never corroborate a claim like "opened/merged PR
#N"
against actual GitHub state. `polylogue-1vpm.6.2`'s investigation
confirmed
no GitHub effect adapter existed at all prior to this PR.

## Solution

- `polylogue/insights/work_effects.py`:
`GitHubPullRequestEffectAdapter.collect()`
now runs `gh pr list --repo <owner/name> --state all --json
number,title,body,
  state,url,createdAt,updatedAt,closedAt,mergedAt,mergeCommit` (the same
subprocess-shelling pattern
`insights.correlation_view._enrich_with_github_api`
  already uses elsewhere in this repo) and turns each PR into one
`ObservedRepositoryEffect` (ref `github-pr:<repo>#<number>`, label
combining
number/state/title/merge-sha/body so
`derive_direct_identifier_judgments`'
existing shared-work-item-id matching links claims to PRs the same way
it
already links commits and Beads interactions). `since_ms`/`until_ms`
filter
  client-side against each PR's most recent known lifecycle timestamp.
Every failure mode -- missing `gh` binary, non-zero exit
(auth/network/rate
limit), timeout, unparseable JSON -- raises
`EffectAdapterUnavailableError`
explicitly, matching the existing git/Beads adapters' "never a silent
empty
  result" contract; `collect_repository_effects` already isolates one
  adapter's failure from the others.
- `polylogue/cli/commands/reconcile_work_effects.py`: new
`--github-repo`
option wires the adapter into the `reconcile-work-effects` CLI alongside
  the existing `--repo`/`--beads-jsonl`.
- Module docstring updated: "two adapters concrete, one stub" -> "three
  adapters concrete."

**Explicitly out of scope**: per-reviewer PR review/approval-level
granularity (as opposed to PR lifecycle state itself) -- tracked
separately
at `polylogue-1vpm.6.2`.

## Verification

```
devtools test tests/unit/insights/test_work_effects.py tests/unit/cli/test_reconcile_work_effects_command.py
# 23 passed in 4.58s

mypy --strict polylogue/insights/work_effects.py polylogue/cli/commands/reconcile_work_effects.py \
  tests/unit/insights/test_work_effects.py tests/unit/cli/test_reconcile_work_effects_command.py
# Success: no issues found in 4 source files

ruff check / ruff format --check <same files>
# clean

devtools render all --check
# no drift

devtools verify --quick
# exit_code 0 (format+lint+mypy+render-all-check+manifests+ci-workflows+
# doc-commands+docs-coverage+test-infra-currency+test-clock-hygiene+
# pytest-timeout-overrides+degrade-loudly+hash-boundary-census)
```

New adapter tests mock only the OS-level `gh` subprocess boundary (no
live
GitHub network/auth access in this test suite, per repo convention)
while
covering: real gh-JSON-shape decode, time-window filtering,
missing-binary,
non-zero-exit, timeout, malformed-JSON, and end-to-end
identifier-judgment
linking. The existing git-commit/Beads-ledger tests are untouched and
continue to exercise real subprocess/file I/O.

## Scope honesty (z9gh AC / bead notes)

This PR delivers **z9gh gap #1 only** ("production git/GitHub/Beads
effect
adapters" -- now fully real for all three sources). It does **not**
address
z9gh's other two named NOT TERMINAL gaps:

- Gap #2: source-to-graph incident materialization -- untouched.
- Gap #3: the real paged/cancelled/cold-model MCP continuity replay --
  untouched.

z9gh should stay open; its bead notes are being updated with this
account
separately (not via this PR).

Ref polylogue-z9gh

Co-Authored-By: Claude <[email protected]>

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant