Add Codex adapter generator#3
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds Codex adapter generation and validation, new TGL lifecycle/reporting scripts, updated documentation templates, and Codex-aware repository docs. ChangesCodex Adapter Feature
Estimated code review effort🎯 5 (Critical) | ⏱️ ~90 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 9
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/library-stinger/templates/documentation-framework.md:
- Line 19: The markdown table entry for Public Knowledge Doc currently uses
unescaped pipe characters inside the location pattern, which can break column
parsing in renderers. Update the documentation-framework template so the pattern
in that cell renders the alternatives without raw table-breaking pipes, and keep
the change localized to the Public Knowledge Doc row in the table.
In @.cursor/skills/library-stinger/templates/documentation-framework.md:
- Line 19: The “Public Knowledge Doc” location pattern in the
documentation-framework table is breaking markdown column parsing because the
pipe characters inside the path are not escaped. Update the table entry to
escape the pipes in the `<overview|guides|faqs>` segment within the
documentation-framework template so the row remains a valid single cell and
renders correctly in markdown.
In `@scripts/tgl-code-map.mjs`:
- Around line 3-4: Reject unsafe --scope values in tgl-code-map.mjs by
validating the scope path before passing it into listFilesRecursive. In the main
argument handling around parseArgs/rel and the repository-root check, ensure any
resolved scope stays within the repo root and does not allow parent-directory
traversal like ../..; if it escapes, fail fast with an error. Use the existing
scope resolution flow in tgl-code-map.mjs and keep the fix centered on the scope
validation logic that feeds listFilesRecursive.
In `@scripts/tgl-inspect-project.mjs`:
- Around line 92-106: The PRD/IRD directory matching in countDirs and the
similar check in tgl-hook-policy currently tests full paths with slash-based
regexes, which breaks on Windows path separators. Update the matching logic in
scripts/tgl-inspect-project.mjs and scripts/tgl-hook-policy.mjs to run the
PRD/IRD regex against basename(p) instead of the full path, using the existing
countDirs helper and the affected PRD/IRD directory filters as the reference
points.
In `@scripts/tgl-ledger.mjs`:
- Around line 3-4: The `--from` handling in `tgl-ledger.mjs` can escape the
`--root` boundary via traversal-style paths, so tighten the path resolution in
the argument parsing and file-selection flow used around `parseArgs`,
`listFilesRecursive`, and the `from` path check. Normalize and resolve the
user-supplied `--from` against the resolved `--root`, then verify the final
target still starts within that root before reading markdown or building the
file list; reject invalid inputs instead of allowing `../`-style traversal.
In `@scripts/tgl-link-pr.mjs`:
- Around line 23-33: The Ship Links block in `scripts/tgl-link-pr.mjs` is being
built and then passed directly into `text.replace`, which can treat `$`
sequences in `args["pr-url"]` or `merge-sha` as replacement tokens; update the
`block`/`text.replace` flow so the replacement is inserted verbatim via a
function replacer. Also fix the `block` construction around `.filter(Boolean)`
so it does not strip the intentional blank lines, preserving the spacing between
the header, PR line, optional merge SHA, and linked timestamp.
In `@scripts/tgl-new-prd.mjs`:
- Line 36: The replacement in tgl-new-prd.mjs is using String.prototype.replace
with args.summary as a raw replacement string, so any $ sequences in
user-provided summaries can be expanded incorrectly. Update the replacement
around the summary placeholder to use a function replacer (or equivalent
verbatim insertion) so args.summary is inserted literally, and keep the fallback
placeholder text behavior unchanged.
In `@scripts/tgl-utils.mjs`:
- Around line 19-20: The option parsing in parseArgs currently defaults missing
values to an empty string, which lets value options like --root silently fall
back to cwd. Update the parser so it fails fast when a value-bearing flag has no
following value instead of assigning "", and make sure the behavior is enforced
in the args handling around args[key] and any callers that rely on the parsed
root path.
- Around line 159-160: The rel() helper currently returns platform-specific
separators, which breaks callers that split on "/" in tgl-code-map.mjs and
tgl-inspect-project.mjs. Update rel() in tgl-utils.mjs to normalize the relative
path to POSIX style before returning it by converting backslashes to forward
slashes, while preserving the "." fallback behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 78371e26-3bd7-4d3c-8091-66879e76aa8f
📒 Files selected for processing (26)
.claude/skills/library-stinger/templates/documentation-framework.md.cursor/skills/library-stinger/templates/documentation-framework.mdAGENTS.mdHOOKS.mdREADME.mdRULES.mdSKILLS.mdcodex/README.mdscripts/build-codex-adapter.mjsscripts/smoke-codex-adapter.mjsscripts/tgl-backwards-prd.mjsscripts/tgl-bootstrap-library.mjsscripts/tgl-code-map.mjsscripts/tgl-complete-work.mjsscripts/tgl-gate-status.mjsscripts/tgl-hook-policy.mjsscripts/tgl-inspect-project.mjsscripts/tgl-ledger.mjsscripts/tgl-link-pr.mjsscripts/tgl-new-adr.mjsscripts/tgl-new-ird.mjsscripts/tgl-new-prd.mjsscripts/tgl-ship-preflight.mjsscripts/tgl-start-work.mjsscripts/tgl-utils.mjsscripts/validate-codex-adapter.mjs
ed33483 to
8d2393f
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/build-codex-adapter.mjs`:
- Around line 668-682: The local-only ignore block added by
appendLocalOnlyGitExclude is never removed when the install mode switches, so a
later committed-project rebuild still leaves .agents/, .codex/, and
AGENTS.that-git-life.md ignored. Update the build flow around
appendLocalOnlyGitExclude and the committed-project path to detect mode changes
and clean those entries back out of .git/info/exclude before regenerating the
adapter, using the same helper names to locate the logic.
- Around line 628-665: `writeRunSummaryTemplate()` is overwriting the
accumulated `.codex/that-git-life/run-summary.json` state on every adapter
rebuild, which loses existing branch/PR/proof data. Update the template write
path in `writeRunSummaryTemplate()` so it only creates the file when it does not
already exist, or otherwise preserves an existing run-summary during reinstall.
Use the existing run-summary handling in `scripts/tgl-run-summary.mjs` as the
source of truth and make sure the adapter setup flow respects previously
recorded data.
In `@scripts/smoke-codex-adapter.mjs`:
- Around line 147-150: The smoke check in smoke-codex-adapter.mjs currently
treats tgl-doctor as passing based only on runJson success, which misses JSON
results with ok: false. Update the logic around the doctor invocation in the
smoke flow to parse the returned doctor payload and explicitly fail the run when
tgl-doctor reports blockers, while keeping the existing
validation/inspect/bootstrap calls intact. Use the tgl-doctor.mjs result shape
and the doctor variable in this script as the key place to add the ok check so
broken installs can no longer report a successful smoke run.
In `@scripts/tgl-run-summary.mjs`:
- Around line 27-31: The count parsing in parseCount currently coerces malformed
inputs to 0, which hides bad CLI values and can incorrectly mark the summary as
valid. Update parseCount and the call sites in the summary update flow to
distinguish missing values from invalid ones: keep undefined for absent flags so
existing totals remain unchanged, but when a provided value is not a finite
non-negative number, fail fast instead of defaulting to 0. Make sure the logic
in the functions that use parseCount and compute the final ok status rejects bad
inputs explicitly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 31b23f67-3154-466d-ab60-a152c3a09227
📒 Files selected for processing (8)
codex/README.mdscripts/build-codex-adapter.mjsscripts/smoke-codex-adapter.mjsscripts/test-codex-adapter.mjsscripts/tgl-doctor.mjsscripts/tgl-run-summary.mjsscripts/tgl-utils.mjsscripts/validate-codex-adapter.mjs
✅ Files skipped from review due to trivial changes (1)
- scripts/test-codex-adapter.mjs
🚧 Files skipped from review as they are similar to previous changes (3)
- codex/README.md
- scripts/validate-codex-adapter.mjs
- scripts/tgl-utils.mjs
|
Follow-up from the TrademarkAura Codex adapter smoke: tightened post-merge closeout so completed PRDs/IRDs move from in-work/backlog to completed, and tgl-complete-work now rewrites EXECUTION_LEDGER.md and run-summary paths. Added focused regression coverage and smoke coverage for this path. |
Summary
.agents/skills,.codex/agents, hooks, runtime scripts, and guidance filesValidation
for f in scripts/*.mjs; do node --check "$f" >/dev/null; donegit diff --cached --checkcore,autopilot, andallprofilesgit diff --cached --checkfor each profilenode scripts/smoke-codex-adapter.mjs --profile autopilotNotes
This PR keeps the source Stingers and Bees as the source of truth. The Codex adapter translates them into Codex-compatible project-local assets so downstream repos can install a deterministic snapshot.
Summary by CodeRabbit