fix(auto): surface assumption_sources through envelope clients#1185
Conversation
PR Q00#1169 added the typed AutoPipelineResult field but left MCP metadata and CLI ledger rendering unable to consume the new assumption_sources contract. Surface the already-computed records through the same envelope channels as the other L4 fields and export the record type from the package API. Constraint: Q00#1157 marks Auto Envelope v2 as frozen and consumed by CLI, MCP, and future UI surfaces. Rejected: leaving rendering as a later follow-up | it keeps the lane paper-complete while MCP clients cannot read the new field. Confidence: high Scope-risk: narrow Directive: keep assumption_sources additive and serialize it as text/source/confidence records. Tested: uv run ruff check src/ouroboros/auto/__init__.py src/ouroboros/mcp/tools/auto_handler.py src/ouroboros/cli/commands/auto.py tests/unit/auto/test_surface.py tests/unit/cli/test_auto_command.py Tested: uv run pytest tests/unit/auto/test_surface.py -k 'ledger_provenance_breakdown or always_emits_provenance_keys or public_api_exports_assumption_record' -q Tested: uv run pytest tests/unit/cli/test_auto_command.py -k 'assumption_sources' -q Tested: uv run pytest tests/unit/auto/test_ledger_grading_answerer.py tests/unit/auto/test_interview_pipeline.py -k 'assumption_sources or assumption_class or surfaces_assumption' -q Tested: uv run mypy src/ouroboros/auto/__init__.py src/ouroboros/mcp/tools/auto_handler.py src/ouroboros/cli/commands/auto.py src/ouroboros/auto/ledger.py src/ouroboros/auto/pipeline.py Not-tested: full repository test suite
There was a problem hiding this comment.
Review — ouroboros-agent[bot]
Verdict: APPROVE
Reviewing commit
d6f19b4for PR #1185
Review record:
bab90f6c-4b89-4528-92fa-d325454a25eb
Blocking Findings
No in-scope blocking findings remained after policy filtering.
Non-blocking Suggestions
None.
Design Notes
Unable to assess architecture or implementation because the required source snapshot and diff could not be read.
Policy Notes
- Omitted 1 finding(s) that referenced files outside the current PR changed-files scope.
Recovery Notes
First recoverable review artifact generated from codex analysis log.
Reviewed by ouroboros-agent[bot] via Codex deep analysis
The prior bot review approved the PR but reported that it could not read the source snapshot/diff, so this empty commit retriggers review without changing the already-verified code. Constraint: user requested iterative bot-feedback incorporation until the design notes are clean. Confidence: medium Scope-risk: narrow Tested: no code changes in this commit Not-tested: no additional tests run for empty retrigger commit Co-authored-by: OmX <omx@oh-my-codex.dev>
The full Python CI checks compare the complete MCP auto progress meta payload. Include the additive assumption_sources empty-list contract there as well, so the focused envelope change remains covered by the broad surface regression test. Constraint: Q00#1157 L4 envelope fields should be present for MCP clients even when computed empty. Rejected: conditional omission when empty | existing provenance fields intentionally distinguish computed-empty from absent. Confidence: high Scope-risk: narrow Tested: uv run ruff check tests/unit/auto/test_surface.py src/ouroboros/mcp/tools/auto_handler.py Tested: uv run pytest tests/unit/auto/test_surface.py -q Tested: uv run pytest tests/unit/cli/test_auto_command.py -k 'assumption_sources' -q Not-tested: full repository test suite locally Co-authored-by: OmX <omx@oh-my-codex.dev>
Merge-readiness rationale after re-reviewing #1169 against #961 / #1157I re-reviewed merged #1169 against the current #961 AgentOS sequencing SSOT and the #1157 What #1169 did#1169 added an additive provenance surface for auto-mode assumptions:
That direction is consistent with the SSOT: L4 is supposed to make the auto result envelope explicit enough that downstream CLI/MCP/UI clients can distinguish user/repo-backed facts from system-made assumptions. The implementation did not introduce a new AgentOS control plane, classifier, state machine, or external dependency, so I do not consider the original approach over-engineered. Gap found and fixed hereThe one gap was envelope reachability. #1169 added the field to This follow-up PR closes that narrow gap by:
Bot / CI status
Why this is safe to mergeThis PR is additive and narrow: it serializes already-computed |
PR Review SummaryVerdictApprove Scope Reviewed
Blocking IssuesNone. WarningsNone. Mutation-Test Thinking
Complexity / CRAP-style Risk
Test Quality Assessment (6/7)
Security / Operational RiskNone. The PR exposes already-computed assumption provenance already present in Looks Good
Final RecommendationApprove. This PR is a narrow, contract-completing follow-up to #1169. It fixes the only material SSOT alignment gap found in the re-review, avoids over-engineering, and is merge-ready with green CI and focused regression coverage. |
There was a problem hiding this comment.
Review — ouroboros-agent[bot]
Verdict: APPROVE
Reviewing commit
be85a47for PR #1185
Review record:
f5d3b575-18dc-45d1-adf0-48f049c251df
Blocking Findings
No in-scope blocking findings remained after policy filtering.
Non-blocking Suggestions
None.
Design Notes
Unable to assess architecture or changed contracts because the review inputs could not be read in this environment.
Policy Notes
- Omitted 1 finding(s) that referenced files outside the current PR changed-files scope.
Recovery Notes
First recoverable review artifact generated from codex analysis log.
Reviewed by ouroboros-agent[bot] via Codex deep analysis
The code audit found the PR direction remains a narrow Q00#1157 L4 envelope completion aligned with Q00#961 rather than a new AgentOS substrate. Add a no-op commit solely to request a fresh bot/source-snapshot review after the previous design note reported a read failure. Constraint: maintainer requested iteration until bot approval and design notes are clean. Rejected: semantic code change | local audit and focused tests found no implementation gap to patch. Confidence: high Scope-risk: narrow Tested: uv run pytest tests/unit/auto/test_surface.py -k 'ledger_provenance_breakdown or always_emits_provenance_keys or public_api_exports_assumption_record or progress' -q Tested: uv run pytest tests/unit/cli/test_auto_command.py -k 'assumption_sources' -q Tested: uv run ruff check src/ouroboros/auto/__init__.py src/ouroboros/mcp/tools/auto_handler.py src/ouroboros/cli/commands/auto.py tests/unit/auto/test_surface.py tests/unit/cli/test_auto_command.py Tested: uv run mypy src/ouroboros/auto/__init__.py src/ouroboros/mcp/tools/auto_handler.py src/ouroboros/cli/commands/auto.py src/ouroboros/auto/ledger.py src/ouroboros/auto/pipeline.py Not-tested: fresh bot review before push Co-authored-by: OmX <omx@oh-my-codex.dev>
The PR already uses Rich markup escaping for assumption-source text and source values. Add focused coverage for bracketed values so the user-visible ledger surface keeps the same safe rendering guarantee while remaining a narrow L4 envelope follow-up. Constraint: Q00#1157 freezes L4 as a CLI/MCP/future-UI envelope contract, so consumer-boundary regressions should be caught at the surface. Rejected: introduce a shared serializer | the current three-field CLI rendering remains simple and a new helper would be premature. Confidence: high Scope-risk: narrow Tested: uv run pytest tests/unit/cli/test_auto_command.py -k 'assumption_sources' -q Tested: uv run ruff check tests/unit/cli/test_auto_command.py Not-tested: full repository test suite locally after this test-only reinforcement Co-authored-by: OmX <omx@oh-my-codex.dev>
The prior test-only reinforcement was semantically correct but failed the CI formatting gate. Apply the formatter output so the bot/CI review can evaluate the actual envelope change instead of a style failure. Constraint: GitHub lint runs ruff format --check across tests. Rejected: force-push amend | preserving the already-pushed review history is safer for the active PR loop. Confidence: high Scope-risk: narrow Tested: uv run ruff check tests/unit/cli/test_auto_command.py Tested: uv run ruff format --check tests/unit/cli/test_auto_command.py Tested: uv run pytest tests/unit/cli/test_auto_command.py -k 'assumption_sources' -q Not-tested: full repository test suite locally Co-authored-by: OmX <omx@oh-my-codex.dev>
There was a problem hiding this comment.
Review — ouroboros-agent[bot]
Verdict: APPROVE
Reviewing commit
c7243acfor PR #1185
Review record:
817ef6fb-c145-44ec-bc7a-bf3002b7df27
Blocking Findings
No in-scope blocking findings remained after policy filtering.
Non-blocking Suggestions
None.
Design Notes
Unable to assess architecture or implementation because the provided diff and files could not be read in this environment.
Policy Notes
- Omitted 1 finding(s) that referenced files outside the current PR changed-files scope.
Recovery Notes
First recoverable review artifact generated from codex analysis log.
Reviewed by ouroboros-agent[bot] via Codex deep analysis
Final merge-readiness rationale after SSOT and bot re-reviewI rechecked this PR against the current #961 AgentOS roadmap SSOT and the sibling #1157 What this PR doesThis is a narrow follow-up to #1169. #1169 introduced the ledger-level This PR closes that specific reachability gap by:
SSOT / over-engineering assessmentI do not see this as over-engineering or a wrong AgentOS direction. The PR does not add a new policy layer, classifier, state machine, schema family, storage path, or control plane. It only routes an already-computed #1169 field through the existing L4 envelope surfaces, matching #1157's frozen Auto Envelope v2 lane and staying outside Track C tier-gate substrate work in #961. The follow-up test-only commit for bracketed CLI values is also intentionally small: it protects the existing Bot / CI status
Local verification
Why this is mergeableThe change is additive, consumer-boundary-focused, and covered at the relevant MCP and CLI surfaces. It preserves the legacy |
PR Review SummaryVerdictApprove Scope Reviewed
Blocking IssuesNone. WarningsNone. Mutation-Test Thinking
Complexity / CRAP-style Risk
Test Quality Assessment (6/7)
Security / Operational RiskNone. The PR exposes already-computed assumption provenance and does not introduce external IO, secrets handling, auth/authz changes, command execution, persistence mutation, timeout/retry behavior, or data migration. Looks Good
Final RecommendationApprove. This PR is a narrow, well-tested envelope-completion follow-up. It fixes the only material reachability gap left by #1169, avoids over-engineering, preserves existing behavior, and is merge-ready. |
There was a problem hiding this comment.
Review — ouroboros-agent[bot]
Verdict: APPROVE
Reviewing commit
c7243acfor PR #1185
Review record:
bd6e6d4d-157d-4e85-8c6e-cf72d46e3d08
Blocking Findings
No in-scope blocking findings remained after policy filtering.
Non-blocking Suggestions
None.
Design Notes
Unable to assess architecture or implementation because the review inputs could not be read in this environment.
Policy Notes
- Omitted 1 finding(s) that referenced files outside the current PR changed-files scope.
Recovery Notes
First recoverable review artifact generated from codex analysis log.
Reviewed by ouroboros-agent[bot] via Codex deep analysis
Fresh independent merge-readiness rationale after #961 / #1157 SSOT recheckI independently re-reviewed this PR against the current #961 AgentOS roadmap SSOT and the sibling #1157 What this PR doesPR #1185 is a narrow follow-up to #1169 and the frozen #1157 L4 Auto Envelope v2 lane. #1169 already introduced ledger-level
SSOT / over-engineering assessmentThis remains aligned with #961 and #1157. It is not a new AgentOS substrate, not a new policy/control plane, not a new schema family, and not a classifier/runtime lane. It only completes the frozen L4 envelope reachability for a field that already exists in the auto pipeline result. That is exactly the kind of Track B / L4 contract-completion follow-up that #961 records outside Track C tier gating. I specifically looked for over-engineering or wrong-direction implementation and did not find it. A shared serializer, new abstraction, or larger UI/client framework would have been premature here; the current direct serialization/rendering is appropriately small. Current evidenceGitHub state:
Fresh local validation from an isolated worktree:
RecommendationMerge. The PR is additive, contract-completing, and covered at the relevant MCP/CLI/package boundaries. It improves the L4 envelope from paper-complete to consumer-reachable without expanding AgentOS scope or weakening any runtime/ledger behavior. |
PR Review SummaryVerdictApprove Scope Reviewed
Blocking IssuesNone. WarningsNone. Mutation-Test Thinking
Complexity / CRAP-style Risk
Test Quality Assessment (6/7)
Security / Operational RiskNone. The PR exposes already-computed assumption provenance and does not introduce external IO, secrets handling, auth/authz changes, command execution, persistence mutation, timeout/retry behavior, or data migration. Looks Good
Final RecommendationApprove. This PR is a narrow, well-tested envelope-completion follow-up. It fixes the remaining consumer reachability gap for |
There was a problem hiding this comment.
Review — ouroboros-agent[bot]
Verdict: APPROVE
Reviewing commit
c7243acfor PR #1185
Review record:
2e55f6f4-f669-4221-bcf8-75ad69611d5a
Blocking Findings
No in-scope blocking findings remained after policy filtering.
Non-blocking Suggestions
None.
Design Notes
Not assessed. The local execution environment prevented reading the PR snapshot and review artifacts.
Policy Notes
- Omitted 1 finding(s) that referenced files outside the current PR changed-files scope.
Recovery Notes
First recoverable review artifact generated from codex analysis log.
Reviewed by ouroboros-agent[bot] via Codex deep analysis
There was a problem hiding this comment.
Review — ouroboros-agent[bot]
Verdict: APPROVE
PR #1185
Branch: fix/auto-assumption-sources-envelope | 5 files, +86/-1 | CI: Bridge TypeScript pass 15s https://github.com/Q00/ouroboros/actions/runs/26293951648/job/77401333900
Scope: architecture-level
HEAD checked: c7243ac9263e150ab79bac1dff659714dae2834f
What Improved
AssumptionRecordis now exported fromouroboros.auto.- MCP auto metadata now always includes
assumption_sources, using[]when empty. - CLI
ooo auto --show-ledgerrenders assumption source, confidence, and text. - Focused tests cover MCP populated/empty metadata, public export, CLI rendering, Rich escaping, and ledger/pipeline provenance behavior.
Issue #N/A Requirements
| Requirement | Status |
|---|---|
Export AssumptionRecord from ouroboros.auto |
Satisfied |
Emit MCP meta.assumption_sources as {text, source, confidence} records |
Satisfied |
Always emit empty MCP assumption_sources as [] |
Satisfied |
Render assumption-source records in CLI --show-ledger output |
Satisfied |
| Add meaningful focused coverage for new public, MCP, and CLI surfaces | Satisfied |
Prior Findings Status
| Prior Finding | Status |
|---|---|
| Prior review context | MODIFIED — Prior CLI Rich-markup escaping concern is withdrawn: current HEAD escapes record.source and record.text before printing, and tests/unit/cli/test_auto_command.py:553 covers bracketed assumption-source output. No prior concern is maintained as a current-HEAD blocker. |
Blockers
| # | File:Line | Severity | Confidence | Finding |
|---|
Follow-ups
| # | File:Line | Priority | Confidence | Suggestion |
|---|---|---|---|---|
| — | — | — | — | None. |
Test Coverage
- Verified locally:
uv run pytest tests/unit/auto/test_surface.py -k "ledger_provenance_breakdown or always_emits_provenance_keys or public_api_exports_assumption_record" -q - Verified locally:
uv run pytest tests/unit/cli/test_auto_command.py -k "assumption_sources" -q - Verified locally:
uv run pytest tests/unit/auto/test_ledger_grading_answerer.py tests/unit/auto/test_interview_pipeline.py -k "assumption_sources or assumption_class or surfaces_assumption" -q - Verified locally:
uv run ruff check src/ouroboros/auto/__init__.py src/ouroboros/mcp/tools/auto_handler.py src/ouroboros/cli/commands/auto.py tests/unit/auto/test_surface.py tests/unit/cli/test_auto_command.py - Verified locally:
uv run mypy src/ouroboros/auto/__init__.py src/ouroboros/mcp/tools/auto_handler.py src/ouroboros/cli/commands/auto.py src/ouroboros/auto/ledger.py src/ouroboros/auto/pipeline.py
Design / Roadmap Gate
Affected-boundary audit covered the ledger provenance producer, typed AutoPipelineResult, MCP metadata projection, CLI ledger rendering, and public package export. The change is additive and does not alter state-machine transitions, persistence schema, replay semantics, or existing assumptions consumers. The MCP contract now exposes the already-computed assumption-source lane consistently with the existing ledger provenance fields.
Merge Recommendation
Post-merge audit found no current-HEAD blocker and no rollback recommendation.
Review-Metadata:
verdict: APPROVE
github_event: COMMENT
review_kind: post_merge_audit
merge_eligible: false
head_sha: c7243ac
source_read_ok: true
diff_read_ok: true
blocking_count: 0
Summary
Follow-up to merged #1169 after re-reviewing it against the #961 / #1157 SSOT direction.
#1169 correctly added the ledger-level
AssumptionRecordand the typedAutoPipelineResult.assumption_sourcesfield, but the L4 Auto Envelope v2 SSOT now says the lane is frozen and consumed by CLI, MCP, and future UI surfaces. Leaving the field only on the internal result object makes the lane paper-complete for MCP clients.This PR closes that narrow envelope gap:
AssumptionRecordfromouroboros.autoalongside the other public auto primitives;meta.assumption_sourcesfrom the MCP auto handler as[{text, source, confidence}]records, always present as[]when empty;ooo auto --show-ledgeroutput;Why this is not over-engineering
This does not add a new policy, classifier, schema family, or control plane. It only routes the already-computed #1169 field through the same envelope channels used by the other L4 fields (
defaulted_sections,evidence_backed_sections,assumption_only_sections).Test plan
uv run ruff check src/ouroboros/auto/__init__.py src/ouroboros/mcp/tools/auto_handler.py src/ouroboros/cli/commands/auto.py tests/unit/auto/test_surface.py tests/unit/cli/test_auto_command.pyuv run pytest tests/unit/auto/test_surface.py -k "ledger_provenance_breakdown or always_emits_provenance_keys or public_api_exports_assumption_record" -quv run pytest tests/unit/cli/test_auto_command.py -k "assumption_sources" -quv run pytest tests/unit/auto/test_ledger_grading_answerer.py tests/unit/auto/test_interview_pipeline.py -k "assumption_sources or assumption_class or surfaces_assumption" -quv run mypy src/ouroboros/auto/__init__.py src/ouroboros/mcp/tools/auto_handler.py src/ouroboros/cli/commands/auto.py src/ouroboros/auto/ledger.py src/ouroboros/auto/pipeline.pyRefs #1169, #1157, #961.