[codex] Add line numbers to Oracle text bundles#239
[codex] Add line numbers to Oracle text bundles#239tristanmanchester wants to merge 2 commits intosteipete:mainsteipete/oracle:mainfrom tristanmanchester:codex/citation-friendly-line-numberstristanmanchester/oracle:codex/citation-friendly-line-numbersCopy head branch name to clipboard
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 3, 2026, 1:51 AM ET / 05:51 UTC. Summary Reproducibility: not applicable. this is a feature PR, not a bug report. The PR body supplies a real CLI render proving the new numbered generated context for the central behavior. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge after maintainers explicitly accept numbered generated context as the new output contract and decide whether the browser/bundle smoke evidence is sufficient for release. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a feature PR, not a bug report. The PR body supplies a real CLI render proving the new numbered generated context for the central behavior. Is this the best way to solve the issue? Yes, with maintainer sign-off: the implementation centralizes generated section rendering while preserving the raw single-section formatter and legacy sectionText. The remaining question is whether the default generated-output contract should change now. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 4490e00b5e23. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Summary
Oracle-generated text context now carries stable line numbers, so models can cite bundled source as
path:lineorpath:line-linewithout guessing whether file citations are accepted. The generated prompt, rendered markdown, browser inline mode, andattachments-bundle.txtall use the numbered view, while raw browser uploads, ZIP entries, legacycreateFileSections().sectionText, and the default exportedformatFileSection(...)helper stay unmodified for compatibility.The public formatter contract is preserved: direct
formatFileSection(path, content)calls still return raw fenced source, callers can opt into numbered output withformatFileSection(..., { lineNumbers: true }), and generated prompt surfaces useformatFileSections(...)so they do not drift. Token accounting follows the numbered generated view, and the default Oracle system prompt now asks for line-specific file citations when line numbers are present.Proof
Real local Oracle render from this branch against source files in this repository, using the TypeScript CLI entrypoint so the output reflects the changed source rather than stale built
dist:The command output is clipped here to the relevant proof window, but it demonstrates the generated
--rendertext view includes the repository-relative path,Lines:range, padded line numbers, and numbered blank/source lines. Separately, tests assert raw upload/ZIP compatibility and thatformatFileSection(...)remains raw by default.Validation
fnm exec --using v24.11.1 pnpm vitest run tests/oracle/markdown.test.ts tests/oracle/oracleExports.test.ts tests/browser/policies.test.ts tests/browser/prompt.test.ts tests/cli/markdownBundle.test.ts tests/cli/runOracle/prompt-and-utils.test.tspassed: 6 files, 57 tests.fnm exec --using v24.11.1 pnpm run checkpassed.git diff --checkpassed.fnm exec --using v24.11.1 pnpm testpassed: 133 files passed, 18 skipped; 1084 tests passed, 41 skipped.Review
Ran
compound-engineering:ce-code-reviewlocally and fixed the actionable findings around token-stat assertions, legacysectionTextdocumentation, shared generated-section rendering, API migration notes, line-specific citation prompting, and the ClawSweeper compatibility/proof blocker. The local review artifact was written to/tmp/compound-engineering/ce-code-review/20260603-054114-d9c6521a/review.json.