Skip to content

fix(reflect): resolve known Codex transcripts at the harness boundary #140

Closed

Description

@dnncha

Reflect currently assumes Claude Code transcript paths and an opening user message in the first JSONL record. Codex stores indexed rollout paths and can place metadata before the opening message.

Add a read-only resolver at the existing harness mapping boundary. It should resolve a known Codex chat ID from the configured runtime home, inspect the index schema, enforce bounded reads, verify the opening user message, and retain the tight digest fallback. Preserve Claude scope restrictions and avoid unrelated transcript discovery.

Validation should cover metadata-first JSONL, redirected configuration homes, ambiguous or missing indexes, malformed input, path scope, and the actual known-chat lookup. Keep deployment behind the existing exact-head live gate.

Activity

  1. dnncha commented on Oct 5, 2026

    @dnncha
    ContributorAuthor

    A tested candidate is available on dnncha/open-pstack, fix/reflect-codex-transcript, head d0ef90479be531831f1704a342a6d6c49b95f685.

    It adds the bounded known-chat resolver and targeted native Reflect lookup/fallback recipes. Validation passed with 31 Python CLI tests, 225 shipped tooling unit tests, 112 verifier tests, strict TypeScript checks and static invariants. Direct lookup is not installed harness evidence.

    The exact-head live gate remains pending. This verifier-changing candidate requires matching publisher revision, project-skill self-tests and claude:skill-invocation:reflect plus codex:skill-invocation:reflect. The verifier requires a same-repository PR. My account could push the fork branch but GitHub rejected upstream PR creation for lack of permission. No plugin installation or release was changed.

  2. dnncha commented on Oct 5, 2026

    @dnncha
    ContributorAuthor

    Independent review found that the initial native recipe could accept an echoed path as execution evidence. The repair is now included in the branch at 23ddb8cc2af0bd3ed07379adba93f40b0038e7d3.

    Codex requires the exact completed resolver command and output redirection. Claude requires a completed successful bounded parent Read returning the fixture records. Echo, helper-source reads, fabricated reports, failed/pending tools and altered commands are rejected.

    The final static gate passes with 31 Python resolver tests, 116 verifier tests and strict typecheck. The shipped tooling suite previously passed all 225 tests and typechecks. The exact-head installed native gate remains pending as stated above; no plugin rollout has occurred.

  3. ericlitman commented on Oct 11, 2026

    @ericlitman
    Owner

    Design pass (advisor: Astra, gpt-6-astra high, read-only), 2026-10-11

    @dnncha, thank you for the tested candidate. We are bringing it into a branch in this repository, because the live gate needs a PR from the same repository. Your commits are credited with a Co-authored-by trailer and in the PR body. The verdict is "bring in with changes":

    Accepted from the review

    • reflect/SKILL.md step 1 becomes one line that points to codex-tools.md#active-transcripts. All harness specifics move into that port-only mapping: the Claude per-project scope, its layouts, the candidate and read limits, opener verification, and the 2,000-word digest limit. This keeps the Cursor-derived file to a one-line divergence.
    • Opener bug. injected_context() rejects the real # AGENTS.md instructions for … header and returns opening_message_mismatch. Astra reproduced this. The fix and a matching fixture are required.
    • Verifier. Keep the reflect success and fallback recipes, reflect.test.ts, and the completed-action assertions. Classify the resolver script with an exact case in core.ts, and drop the new Registry.skillPaths property and its validator. The recipe prompts must not give the agent the resolver command; the installed mapping has to lead it there.
    • Local Codex layout. On this Mac, state_5.sqlite has a threads table with primary key id and a rollout_path column, for codex-cli 0.159 and 0.160. So discovery narrows to state_*.sqlite files and that table. Generic discovery of arbitrary tables is removed.

    Changed against the review: the resolver is rewritten in Bun TypeScript

    • The shipped plugin has no Python today. docs/reference.md lists Bun and Node as the only runtimes for its tooling, so keeping the Python script would add python3 as a user prerequisite.
    • Astra kept Python only for SQLite's per-query work limit. The lookup is an exact primary-key query against the user's own Codex state database, so that limit protects against nothing in actual use.
    • bun:sqlite in read-only mode with a bound parameter covers the lookup. The bounded transcript reads that this issue requires stay: fixed record and byte limits, held as constants, with no CLI flags.

    Not changed in this PR: CHANGES.md, which is written at release time. The NOTICE.md provenance lines and the UPSTREAM.md ledger entry stay, rewritten for the new shape.

  4. ericlitman commented on Oct 11, 2026

    @ericlitman
    Owner

    Opened #151 from a branch in this repository, based on @dnncha's candidate (credited with Co-authored-by on every commit). The design changes are listed in the comment above and in the PR body.

  5. added a commit that references this issue on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions