Skip to content

feat(storage): enforce typed tool outcomes - #4502

Merged
Sinity merged 6 commits into
masterfrom
feature/packet/polylogue-xd0ha
Sep 1, 2026
Merged

Sinity merged 6 commits into
masterfrom
feature/packet/polylogue-xd0ha

Conversation

@Sinity

@Sinity Sinity commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

Admit deliberate unknown tool outcomes as ToolOutcome.UNKNOWN, preserve their parser reason, and keep action surfaces honest across Claude Code, Codex, and Hermes transcripts.

Problem

The writer refused real Claude Code and Codex results whose parser evidence deliberately recorded not_reported or distrusted. The prior lane also converted unknown action assertions to success and removed no-verdict shapes from synthetic generators.

Solution

The writer derives unknown from tool_result_outcome_unknown_reason, preserves the reason, and leaves legacy error and exit-code fields null. Codex and Hermes parser paths retain not_reported for unresolved structural results. Action SQL maps the canonical value to outcome_unknown. Claude Code, Codex, and tool-heavy synthetic generators can again emit no-verdict results. A parser-to-writer regression covers both real parser routes, and the restored assertions expect OUTCOME_UNKNOWN with tool_success is None. Index schema v82 declares semantic replay for the changed derived DDL.

Verification

  • .venv/bin/python -m devtools test tests/unit/storage/test_tool_outcome.py tests/unit/core/test_synthetic_semantics.py::TestWireFormatShape tests/unit/sources/test_claude_code_unread_wire_fields.py tests/unit/sources/test_tool_result_structural_outcome.py tests/unit/sources/parsers/test_hermes_state.py tests/unit/sources/test_parsers_codex_catalog.py::test_codex_catalog_parser_only_smoke passed: 59 passed.
  • Read-only parser census through prepare_session_rows: 143 sampled Claude Code files with 11,259 tool results and 0 refusals; 116 sampled Codex files with 46,414 tool results and 0 refusals. Deliberate unknown reasons were retained in both populations.
  • git fetch origin master && git rebase origin/master passed. The lane uses schema v82, above the v80 and v81 claims present in other active worktrees.
  • .venv/bin/python -m devtools verify --quick passed: all quick checks green, including schema versioning.

Residual risk: the complete 59 GB local JSONL corpus and live daemon convergence were not run. The malformed source file noted in the prior review remains an input-quality issue, not a typed-outcome refusal.

Reviewed-by: Claude (Opus) cross-family review

@Sinity
Sinity enabled auto-merge (squash) September 1, 2026 09:29
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 6685eaf0-b096-4737-8317-860ee2c108cd


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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-01T09:38:37.201395Z f1c22df PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Sinity
Sinity merged commit e7c9341 into master Sep 1, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the feature/packet/polylogue-xd0ha branch September 1, 2026 09:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1c22df505

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sinity added a commit that referenced this pull request Sep 3, 2026
fable-packet lives under `ops insights` (#4580 removed the root alias);
beads has no rendering policy (#4598); Claude Code tool results with an
exit code emit claude_tool_execution_result (#4502); the direct status
fallback reports "daemon idle" with the start hint; the integration
workload is a third default seeded artifact (#4532).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
Sinity added a commit that referenced this pull request Sep 3, 2026
The upward walk that resolves a session's repository stopped at nothing,
so with the managed temp trees inside the checkout every scratch path
resolved to the checkout itself. The walk now stops before a listed
ceiling, as git does, and the ceiling is part of the normalization
cache key.

Tests: tool results without structural evidence are admitted as unknown
with not_reported (#4539) and the writer refusal is exercised on a block
with no evidence at all; block payloads carry tool_outcome (#4502); a
provider-reported cost rolls up as "exact" (#4493); the v61 replace-table
keeps the surviving canonical columns; the bulk-delete canaries and the
naive-join survivor use TEMP objects on the opened connection so the
schema manifest check at open no longer refuses them (#4472, #4594).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Closing out open Codex review threads on this PR (evidence checked against master at 8e6234c):

Resolving every thread listed; confirmed defects are fixed under the named bead.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 68.F006 / P1: fixed-already at the checked revision: polylogue/material_protocol/v1/constants.py:21 assigns canonical block tool outcomes to semantics v3, and line 27 now advertises v5. The new block shape is therefore not published under the old v2 identifier.

Only the rows listed above are dispositioned. Held findings remain open.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 74.F026 / P1: fixed-already at the checked revision: The shared repository block projection now selects tool_outcome at polylogue/storage/sqlite/queries/attachment_blocks.py:36 alongside the structural outcome columns, so repository hydration receives the canonical stored value rather than relying on the model default.

Only the rows listed above are dispositioned. Held findings remain open.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 76.F008 / P1: fixed-already at the checked revision: The append path re-pairs all stored tool uses and results in transcript order and updates the earlier use block outcome, instead of deriving only the new tail. See polylogue/storage/sqlite/archive_tiers/write.py:4599.
  • 76.F009 / P1: fixed-already at the checked revision: ChatGPT missing, in-progress and unrecognized statuses now produce an explicit unknown reason for each output branch; the shared derivation also accepts an absent reason rather than applying the retired unconditional refusal. See polylogue/sources/parsers/chatgpt.py:408.
  • 76.F010 / P1: fixed-already at the checked revision: ChatGPT missing, in-progress and unrecognized statuses now produce an explicit unknown reason for each output branch; the shared derivation also accepts an absent reason rather than applying the retired unconditional refusal. See polylogue/sources/parsers/chatgpt.py:408.
  • 76.F011 / P1: fixed-already at the checked revision: The union chooses one source row for the complete tool verdict and copies every correlated verdict column together, including None values, rather than independently coalescing contradictory legacy and unknown fields. See polylogue/storage/sqlite/archive_tiers/write.py:4966.

Only the rows listed above are dispositioned. Held findings remain open.

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