Skip to content

Audit current structure cleanup#148

Merged
ndycode merged 9 commits into
mainfrom
audit/current-structure-cleanup-20260425
Apr 25, 2026
Merged

Audit current structure cleanup#148
ndycode merged 9 commits into
mainfrom
audit/current-structure-cleanup-20260425

Conversation

@ndycode
Copy link
Copy Markdown
Owner

@ndycode ndycode commented Apr 25, 2026

Summary

  • Regenerated docs/audits against current source SHA 3331324 and aligned docs/AGENTS/testing guidance with the current docs tree and 21-tool lib/tools registry.
  • Fixed validated current-structure drift: CI now runs audit:ci, config model IDs are checked against MODEL_MAP, static OpenAI-style secret fixtures are avoided, and the stale lib/tools/_shared barrel is removed.
  • Added a clean-dist build guard so deleted source files cannot leave stale dist artifacts in npm pack output; verified the rebuilt tarball no longer ships _shared outputs.
  • Tracked the calibrated branch coverage floor follow-up in issue Raise branch coverage floors after current-structure audit #149.

Testing

  • npm.cmd ci
  • npm.cmd test -- test/doc-parity.test.ts test/model-map.test.ts test/index.test.ts
  • npm.cmd test -- test/clean-dist.test.ts test/doc-parity.test.ts
  • npm.cmd run lint
  • npm.cmd run typecheck
  • npm.cmd test (84 files, 2369 passed, 1 skipped)
  • npm.cmd run test:coverage (statements 80.39%, branches 71.62%, functions 89.01%, lines 81.94%)
  • npm.cmd run build
  • npm.cmd run audit:ci
  • npm.cmd pack --json --pack-destination C:\temp\oc-codex-smoke-148-deep-20260425-1406\pack
  • Tarball check confirmed no stale _shared outputs
  • Fresh temp install of oc-codex-multi-auth-6.1.7.tgz with --ignore-scripts
  • ESM import smoke for oc-codex-multi-auth and oc-codex-multi-auth/tui
  • Installer dry-run smoke against a temp HOME with --no-cache-clear

Compliance Confirmation

  • This change stays within the repository scope and OpenAI Terms of Service expectations.
  • This change uses official authentication flows only and does not add bypass, scraping, or credential-sharing behavior.
  • I updated tests and documentation when the change affected users, maintainers, or repository behavior.

Notes

  • Linked follow-up: Raise branch coverage floors after current-structure audit #149 tracks raising the branch coverage floors after focused coverage work.
  • No active Critical or High audit findings remain in the refreshed corpus.
  • npm audit still reports existing low/moderate dependency advisories in OpenCode/TUI dependency chains, but audit:ci passes under the configured high-severity production gate plus dev allowlist.

note: greptile review for oc-chatgpt-multi-auth. cite files like lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.

Greptile Summary

this pr regenerates the full audit corpus against the current source sha and fixes six specific validation findings: the metrics topic mismatch in codex-help, the force=true overwrite default in codex-export, missing confirm=true in codex-remove guidance, reasoning.encrypted_content in minimal config, the installer direct-run path detection refactor (logic now lives in the core module), and coverage threshold calibration to the measured baseline. docs, tests, and ci are all aligned post-split with the 21-tool registry.

Confidence Score: 5/5

safe to merge — all p1 findings from prior review resolved, only p2 style notes remain

no p0 or p1 findings in this review. the previous p1 (metrics topic mismatch) is definitively fixed. the force=false flip and confirm=true guidance fixes are correct and safer. two p2 notes: the index.ts branch threshold drop to 50% is acknowledged and tracked in #149, and the direct-run guard in clean-dist.js omits realpathSync. neither blocks merge.

vitest.config.ts — the index.ts 50% branch floor is the lowest threshold in the repo for a production file; worth revisiting once #149 lands

Important Files Changed

Filename Overview
lib/tools/codex-help.ts fixed: removed metrics from advertised topics and tightened filter to strict ===; all sections now match the schema description exactly
lib/tools/codex-export.ts fixed: force default flipped from true to false, preventing silent overwrites on windows where file-lock races (EPERM) could corrupt backups
lib/tools/codex-remove.ts guidance messages aligned: all user-facing hints now include confirm=true matching the tool's required argument
scripts/clean-dist.js new pre-build dist cleaner with a relative() guard ensuring only dist/ is deleted; windows-aware path normalization is correct but the direct-run guard skips realpathSync unlike the installer
scripts/install-oc-codex-multi-auth-core.js normalizePathForCompare and isDirectRunPath moved here from the wrapper; added !modulePath null guard; windows lowercase normalization preserved correctly
scripts/install-oc-codex-multi-auth.js wrapper simplified to delegate to core; resolveRealPath now correctly passes undefined to core which has its own realpathSync default
vitest.config.ts global branch floor lowered 80→70%, index.ts branches lowered 70→50% to match measured baseline; tracked in #149 but the entrypoint floor is notably low
lib/tools/_shared.ts deleted: barrel was a no-op re-export of runtime.ts; tools now import directly from source
lib/tools/index.ts stale rc-1 scaffolding comments removed; tool count updated to 21; ToolContext doc aligned with current registry
test/doc-parity.test.ts expanded with 9 new parity assertions: tool layout count, config fragment checks, stale anchor scanning, secret pattern detection, and path reference resolution
test/clean-dist.test.ts new tests covering happy path, sibling file preservation, and non-dist path rejection for cleanDist()
config/minimal-opencode.json added include: ["reasoning.encrypted_content"] to the openai provider options, aligning with the stateless contract tested in doc-parity.test.ts

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["npm run build"] --> B["node scripts/clean-dist.js"]
    B --> C{"relative(repoRoot, distDir) === 'dist'?"}
    C -- "no" --> D["throw: Refusing to clean non-dist path"]
    C -- "yes" --> E["fs.rm(dist/, recursive, force)"]
    E --> F["tsc"]
    F --> G["node scripts/copy-oauth-success.js"]
    G --> H["dist/ ready"]

    subgraph "codex-help fix"
        I["topic param"] --> J{"normalizedTopic.length === 0?"}
        J -- "yes" --> K["show all sections"]
        J -- "no" --> L{"section.key === normalizedTopic"}
        L -- "match" --> M["show section"]
        L -- "no match" --> N["Unknown topic error"]
    end

    subgraph "codex-export fix"
        O["force param"] --> P{"force ?? false"}
        P -- "false (default)" --> Q["exportAccounts safe-write"]
        P -- "true (explicit)" --> R["exportAccounts overwrite"]
    end
Loading

Comments Outside Diff (2)

  1. lib/tools/codex-help.ts, line 22-25 (link)

    P1 metrics topic advertised but never defined

    the schema description lists "metrics" as a valid topic, but no section with key: "metrics" exists in the sections array (only setup, switch, health, dashboard, backup). before this PR the substring filter would just return no results silently; now that the filter uses strict ===, any caller (llm, user, or automated agent) that passes topic: "metrics" will immediately get "Unknown topic: metrics" — breaking the documented contract. either add the section or drop metrics from the description.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: lib/tools/codex-help.ts
    Line: 22-25
    
    Comment:
    **`metrics` topic advertised but never defined**
    
    the schema description lists `"metrics"` as a valid topic, but no section with `key: "metrics"` exists in the `sections` array (only `setup`, `switch`, `health`, `dashboard`, `backup`). before this PR the substring filter would just return no results silently; now that the filter uses strict `===`, any caller (llm, user, or automated agent) that passes `topic: "metrics"` will immediately get `"Unknown topic: metrics"` — breaking the documented contract. either add the section or drop `metrics` from the description.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Codex

  2. lib/tools/codex-help.ts, line 24 (link)

    P1 metrics topic advertised but never defined

    the schema description still lists "metrics" as a valid topic, but no section with key: "metrics" exists in the sections array (only setup, switch, health, dashboard, backup). now that the filter was tightened to strict === in this pr, any caller that passes topic: "metrics" will immediately receive "Unknown topic: metrics" — breaking the documented contract. the previous includes behaviour would silently return nothing, but the new strict filter makes the mismatch a hard, visible failure. either add the missing section or drop metrics from the description.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: lib/tools/codex-help.ts
    Line: 24
    
    Comment:
    **`metrics` topic advertised but never defined**
    
    the schema description still lists `"metrics"` as a valid topic, but no section with `key: "metrics"` exists in the `sections` array (only `setup`, `switch`, `health`, `dashboard`, `backup`). now that the filter was tightened to strict `===` in this pr, any caller that passes `topic: "metrics"` will immediately receive `"Unknown topic: metrics"` — breaking the documented contract. the previous `includes` behaviour would silently return nothing, but the new strict filter makes the mismatch a hard, visible failure. either add the missing section or drop `metrics` from the description.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Codex

Fix All in Codex

Prompt To Fix All With AI
This is a comment left during a code review.
Path: vitest.config.ts
Line: 39-43

Comment:
**`index.ts` branch floor halved to 50%**

`index.ts` is the plugin entrypoint — it wires the full tool registry and owns the auth plugin class. dropping its branch threshold from 70% to 50% means up to half of its conditional paths can be untested without breaking ci. the pr notes track this in #149, which is good, but 50% is a wide regression window. consider whether the `lib/**/*.ts` per-file floor of 70% can be extended to cover `index.ts` as well, or whether adding integration-level tests for the auth plugin branches could lift this back above 70% before the threshold is lowered permanently.

**Context Used:** speak in lowercase, concise sentences. act like th... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: scripts/clean-dist.js
Line: 25

Comment:
**direct-run guard uses raw path compare instead of `realpathSync`**

`resolve(process.argv[1]) === __filename` is a simple string compare that will fail when the script is invoked via a symlink (e.g., a global npm bin link on windows or linux). the installer already solved this with `isDirectRunPath` + `realpathSync`; `clean-dist.js` would benefit from the same pattern — particularly relevant on windows where `npm run build` may invoke the script through a junction or shim.

or simply import `isDirectRunPath` from the installer core once it's stable as a shared utility.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (6): Last reviewed commit: "docs: track coverage follow-up" | Re-trigger Greptile

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 25, 2026

📝 Walkthrough

Walkthrough

This pull request updates project documentation and configuration across multiple audit reports, module guidance, and a provider config setting. The audit documentation is substantially condensed from detailed findings to status summaries, while module responsibilities in AGENTS.md are clarified and an OpenAI provider configuration is updated to include encrypted reasoning content.

Changes

Cohort / File(s) Summary
Module and Project Guidance
AGENTS.md, docs/DOCUMENTATION.md
Updated module responsibilities documentation, expanded storage facade/keychain description, added tool registry location, and updated test coverage phrasing. Added navigation structure and new documentation sections for FAQ, OpenCode proposal, and audits subdirectory.
Provider Configuration
config/minimal-opencode.json
Added include directive for reasoning.encrypted_content while maintaining store: false in OpenAI provider configuration.
Audit Report Condensation
docs/audits/01-executive-summary.md, docs/audits/02-system-map.md, docs/audits/03-critical-issues.md, docs/audits/04-high-priority.md, docs/audits/05-medium.md, docs/audits/06-low-priority.md, docs/audits/07-refactoring-plan.md, docs/audits/08-feature-recommendations.md, docs/audits/09-security-trust.md, docs/audits/10-testing-gaps.md, docs/audits/11-dx-cli-docs.md, docs/audits/12-quick-wins.md, docs/audits/13-phased-roadmap.md, docs/audits/14-top20.md, docs/audits/15-file-by-file.md, docs/audits/16-verdict.md, docs/audits/INDEX.md
Restructured audit reports to replace detailed findings with concise status summaries, updated metadata headers (audit source and generation timestamps), removed extensive severity breakdowns and recommendations, added current architecture snapshots and behavioral gates summary. Reports now focus on resolved vs. remaining items.
Audit Findings Subdirectory
docs/audits/_findings/T01-architecture.md through docs/audits/_findings/T16-code-health.md (16 files)
Extensively rewritten audit-topic findings from comprehensive technical analysis (with code references, enumerated findings, and severity counts) to brief status updates with high-level module/behavior snapshots and residual notes. Removed detailed evidence, prior findings ledger structure, and quantified severity inventories.
Audit Metadata and Support
docs/audits/_meta/AUDIT-RUBRIC.md, docs/audits/_meta/dedup-report.md, docs/audits/_meta/environment.md, docs/audits/_meta/f1-post-merge-review.md
Updated audit rubric with concise severity categories and current cap result, condensed dedup report from cluster tables to simplified categories, refreshed environment metadata (tool/package versions, module count), replaced post-merge review with minimal placeholder.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A field of docs now tidied neat,
Where once the audit findings were long,
Brief snapshots bring a cleaner beat,
With status bright and config strong!
Current structure shines so clear,
All resolved, and nothing to fear!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change—a comprehensive audit corpus and documentation refresh aligned with the current codebase structure and 21-tool registry reorganization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed PR description is comprehensive with clear summary of changes, detailed testing steps completed, explicit compliance confirmation, and follow-up tracking.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch audit/current-structure-cleanup-20260425

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (6)
docs/audits/08-feature-recommendations.md (1)

7-10: Minor readability polish for repeated sentence openings.

Lines 7–10 start with the same verb pattern repeatedly; consider slight rewording to reduce repetition and improve scanability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/audits/08-feature-recommendations.md` around lines 7 - 10, The four list
items all start with the same verb "Add", making the list repetitive; rephrase
each entry (e.g., use varied openings like "Provide", "Create", "Support",
"Generate" or convert some into gerunds/imperatives) to improve readability
while keeping the commands intact—specifically update the lines referencing
`codex-export format=json`, the package-smoke script description (`npm pack` /
temp project / ESM entry / installer dry-run), `codex-doctor exportPath=<file>`,
and the current-structure docs generator so each line begins differently and
scans better.
docs/audits/10-testing-gaps.md (1)

7-11: Optional: Vary sentence structure for readability.

Four consecutive bullets begin with the same pattern ("test/X covers..."). While clear, varying the structure could improve flow.

✨ Suggested rewording
 Current high-value coverage:
 
-- `test/index.test.ts` covers tool registration and extracted tool behavior through plugin wiring.
-- `test/tools-codex-*.test.ts` covers focused tool regressions.
-- `test/storage.test.ts` covers non-destructive export defaults.
-- `test/doc-parity.test.ts` now covers config contract, tool registry count, and stale audit anchors.
+- Tool registration and plugin wiring: `test/index.test.ts`
+- Focused tool regressions: `test/tools-codex-*.test.ts`
+- Non-destructive export defaults: `test/storage.test.ts`
+- Config contract, tool registry count, and stale audit anchors: `test/doc-parity.test.ts`
 - `test/contracts/*` pins Codex response shapes.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/audits/10-testing-gaps.md` around lines 7 - 11, Rewrite the consecutive
bullet lines so they vary sentence structure while preserving meaning; instead
of repeating "test/... covers..." start some bullets with verbs or clauses
(e.g., "Tool registration and extracted tool behavior are exercised by
test/index.test.ts", "Focused regressions are validated in
test/tools-codex-*.test.ts", "Non-destructive export defaults are checked in
test/storage.test.ts", "test/doc-parity.test.ts now asserts the config contract,
tool registry count, and stale audit anchors", and "Response shapes are pinned
in test/contracts/*") — update the bullets accordingly to improve flow while
keeping the same file references and intent.
docs/audits/_findings/T06-filesystem.md (1)

11-15: Optional: Vary sentence structure.

Five consecutive bullets use "owns" to describe module responsibilities. Consider varying the phrasing for better readability.

✨ Suggested rewording
 Current filesystem ownership:
 
-- `lib/storage/paths.ts` resolves config roots.
-- `lib/storage/load-save.ts` owns account load/save and transactions.
-- `lib/storage/atomic-write.ts` owns atomic write primitives.
-- `lib/storage/worktree-lock.ts` owns lock behavior.
-- `lib/storage/export-import.ts` owns import/export safety.
+- Config root resolution: `lib/storage/paths.ts`
+- Account load/save and transactions: `lib/storage/load-save.ts`
+- Atomic write primitives: `lib/storage/atomic-write.ts`
+- Lock behavior: `lib/storage/worktree-lock.ts`
+- Import/export safety: `lib/storage/export-import.ts`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/audits/_findings/T06-filesystem.md` around lines 11 - 15, The five
consecutive bullets all use the verb "owns," which is repetitive; edit the
bullets for lib/storage/paths.ts, lib/storage/load-save.ts,
lib/storage/atomic-write.ts, lib/storage/worktree-lock.ts, and
lib/storage/export-import.ts to use varied verbs that reflect each module's
responsibility (e.g., "resolves" or "calculates" for paths, "handles" or
"manages" for load-save and transactions, "implements" or "provides" for
atomic-write, "controls" or "coordinates" for worktree-lock, and "ensures" or
"validates" for export-import) so the list reads more naturally while preserving
the original meaning.
docs/audits/_meta/dedup-report.md (1)

7-10: Optional: Vary bullet structure.

Three consecutive bullets begin with "Collapse" and end with "resolved ... row." Consider varying the phrasing.

✨ Suggested rewording
 Deduplication policy:
 
 - Prefer current-source findings over historical claims.
-- Collapse repeated old monolith claims into one resolved architecture row.
-- Collapse destructive-export claims into one resolved tool/storage row.
-- Collapse config continuity claims into one resolved config row.
+- Repeated old monolith claims → single resolved architecture row.
+- Destructive-export claims → single resolved tool/storage row.
+- Config continuity claims → single resolved config row.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/audits/_meta/dedup-report.md` around lines 7 - 10, The three consecutive
bullets that all start with "Collapse" and end with "resolved ... row"
(specifically the lines containing "Collapse repeated old monolith claims into
one resolved architecture row.", "Collapse destructive-export claims into one
resolved tool/storage row.", and "Collapse config continuity claims into one
resolved config row.") are repetitive; rewrite them to vary sentence structure
while preserving meaning—for example, keep the first as-is, change the others to
use different verbs or passive constructions such as "Aggregate repeated
destructive-export claims into a single resolved tool/storage row" and
"Consolidate config continuity claims into one resolved config row" or similar
phrasing, so each bullet starts differently and avoids the identical "Collapse
... resolved ... row" pattern.
docs/audits/_findings/T16-code-health.md (1)

11-15: Optional: Vary sentence structure.

Four bullets use "is" to describe module characteristics. Consider varying the structure for better flow.

✨ Suggested rewording
 Current code-health evidence:
 
-- `index.ts` is 3694 lines but no longer owns inline tool bodies.
-- `lib/storage.ts` is a 79-line facade.
-- `lib/accounts.ts` is a 366-line facade/orchestrator.
+- `index.ts`: 3694 lines (no longer owns inline tool bodies)
+- `lib/storage.ts`: 79-line facade
+- `lib/accounts.ts`: 366-line facade/orchestrator
 - `lib/tools/index.ts` maps exactly 21 tool factories.
 - Largest remaining concentration is the request layer.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/audits/_findings/T16-code-health.md` around lines 11 - 15, The four
bullets currently all use the same "is" structure (e.g. "`index.ts` is 3694
lines", "`lib/storage.ts` is a 79-line facade.", "`lib/accounts.ts` is a
366-line facade/orchestrator.", "`lib/tools/index.ts` maps exactly 21 tool
factories.")—please vary sentence structure for better flow by rephrasing at
least two bullets (for example: "index.ts spans 3694 lines", "lib/storage.ts
serves as a 79-line facade", "lib/accounts.ts functions as a 366-line
orchestrator/facade", or "lib/tools/index.ts maps 21 tool factories") while
preserving the original facts and conciseness.
docs/audits/_findings/T02-security.md (1)

19-19: Consider clarifying the keychain opt-in model.

The phrasing "JSON storage remains available for users who do not opt into the native keychain" is technically correct but could be clearer. Based on the code snippets showing lib/storage/keychain.ts implementation, JSON is the default storage backend, and keychain is an opt-in enhancement (via CODEX_KEYCHAIN=1).

Consider rephrasing to: "JSON storage is the default backend; users may opt into native keychain via CODEX_KEYCHAIN=1 for enhanced security."

This makes the opt-in nature and default behavior clearer without changing the technical accuracy.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/audits/_findings/T02-security.md` at line 19, Update the sentence to
clearly state that JSON is the default and the native keychain is opt-in: reword
the line to something like "JSON storage is the default backend; users may opt
into native keychain via CODEX_KEYCHAIN=1 for enhanced security." Reference the
keychain implementation (lib/storage/keychain.ts) and the environment flag
(CODEX_KEYCHAIN) to ensure the phrasing matches the actual opt-in behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Line 13: The README line claiming a "7-step fetch pipeline" is inaccurate;
update the text referencing index.ts (the plugin entry) to reflect the actual
implementation by either changing "7-step fetch pipeline" to "2-step fetch
pipeline" (matching the explicit Step 1 and Step 3 labels in index.ts) or,
preferably, to "5-stage fetch pipeline" and list the five implemented operations
(URL rewriting, request body transformation, OAuth header injection, SSE
conversion, and error handling) so the documentation matches the
symbols/behavior in index.ts.

In `@docs/audits/_findings/T04-request-pipeline.md`:
- Around line 11-14: Update the documentation to explicitly state that
transformRequestBody also enforces stream=true in addition to store: false; edit
the T04-request-pipeline.md content where the contract bullets are listed to add
a line or amend the existing bullet referencing transformRequestBody so it reads
that transformRequestBody forces both store: false and stream: true, and include
a brief note linking this behavior to the request pipeline/components that rely
on it (e.g., transformRequestBody and any callers in the request pipeline).

In `@docs/audits/_findings/T10-error-handling.md`:
- Line 11: The schema in lib/tools/codex-help.ts advertises a "metrics" topic
but the sections array lacks a section with key "metrics", so update codex-help
to either add a corresponding help section object (with key "metrics" and the
appropriate title/content) into the sections array or remove "metrics" from the
advertised topics in the exported schema; locate the schema and sections array
in lib/tools/codex-help.ts (the exported help schema/array used by codex-help)
and make the change so advertised topics and actual section keys stay in sync.

In `@docs/audits/11-dx-cli-docs.md`:
- Line 7: Update the codex-help schema description to stop advertising the
nonexistent "metrics" topic by removing "metrics" from the topics list string
(the literal: "Optional topic: setup, switch, health, backup, dashboard,
metrics.") so it reads without "metrics"; modify the line in
docs/audits/11-dx-cli-docs.md that contains that schema description to reflect
the corrected topics list for the codex-help entry.

---

Nitpick comments:
In `@docs/audits/_findings/T02-security.md`:
- Line 19: Update the sentence to clearly state that JSON is the default and the
native keychain is opt-in: reword the line to something like "JSON storage is
the default backend; users may opt into native keychain via CODEX_KEYCHAIN=1 for
enhanced security." Reference the keychain implementation
(lib/storage/keychain.ts) and the environment flag (CODEX_KEYCHAIN) to ensure
the phrasing matches the actual opt-in behavior.

In `@docs/audits/_findings/T06-filesystem.md`:
- Around line 11-15: The five consecutive bullets all use the verb "owns," which
is repetitive; edit the bullets for lib/storage/paths.ts,
lib/storage/load-save.ts, lib/storage/atomic-write.ts,
lib/storage/worktree-lock.ts, and lib/storage/export-import.ts to use varied
verbs that reflect each module's responsibility (e.g., "resolves" or
"calculates" for paths, "handles" or "manages" for load-save and transactions,
"implements" or "provides" for atomic-write, "controls" or "coordinates" for
worktree-lock, and "ensures" or "validates" for export-import) so the list reads
more naturally while preserving the original meaning.

In `@docs/audits/_findings/T16-code-health.md`:
- Around line 11-15: The four bullets currently all use the same "is" structure
(e.g. "`index.ts` is 3694 lines", "`lib/storage.ts` is a 79-line facade.",
"`lib/accounts.ts` is a 366-line facade/orchestrator.", "`lib/tools/index.ts`
maps exactly 21 tool factories.")—please vary sentence structure for better flow
by rephrasing at least two bullets (for example: "index.ts spans 3694 lines",
"lib/storage.ts serves as a 79-line facade", "lib/accounts.ts functions as a
366-line orchestrator/facade", or "lib/tools/index.ts maps 21 tool factories")
while preserving the original facts and conciseness.

In `@docs/audits/_meta/dedup-report.md`:
- Around line 7-10: The three consecutive bullets that all start with "Collapse"
and end with "resolved ... row" (specifically the lines containing "Collapse
repeated old monolith claims into one resolved architecture row.", "Collapse
destructive-export claims into one resolved tool/storage row.", and "Collapse
config continuity claims into one resolved config row.") are repetitive; rewrite
them to vary sentence structure while preserving meaning—for example, keep the
first as-is, change the others to use different verbs or passive constructions
such as "Aggregate repeated destructive-export claims into a single resolved
tool/storage row" and "Consolidate config continuity claims into one resolved
config row" or similar phrasing, so each bullet starts differently and avoids
the identical "Collapse ... resolved ... row" pattern.

In `@docs/audits/08-feature-recommendations.md`:
- Around line 7-10: The four list items all start with the same verb "Add",
making the list repetitive; rephrase each entry (e.g., use varied openings like
"Provide", "Create", "Support", "Generate" or convert some into
gerunds/imperatives) to improve readability while keeping the commands
intact—specifically update the lines referencing `codex-export format=json`, the
package-smoke script description (`npm pack` / temp project / ESM entry /
installer dry-run), `codex-doctor exportPath=<file>`, and the current-structure
docs generator so each line begins differently and scans better.

In `@docs/audits/10-testing-gaps.md`:
- Around line 7-11: Rewrite the consecutive bullet lines so they vary sentence
structure while preserving meaning; instead of repeating "test/... covers..."
start some bullets with verbs or clauses (e.g., "Tool registration and extracted
tool behavior are exercised by test/index.test.ts", "Focused regressions are
validated in test/tools-codex-*.test.ts", "Non-destructive export defaults are
checked in test/storage.test.ts", "test/doc-parity.test.ts now asserts the
config contract, tool registry count, and stale audit anchors", and "Response
shapes are pinned in test/contracts/*") — update the bullets accordingly to
improve flow while keeping the same file references and intent.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: df7ffce5-7690-42b0-b484-d316750b4988

📥 Commits

Reviewing files that changed from the base of the PR and between 3331324 and 911bdd4.

⛔ Files ignored due to path filters (2)
  • docs/audits/_meta/findings-ledger.csv is excluded by !**/*.csv
  • docs/audits/_meta/sha.lock is excluded by !**/*.lock
📒 Files selected for processing (63)
  • AGENTS.md
  • config/minimal-opencode.json
  • docs/DOCUMENTATION.md
  • docs/audits/01-executive-summary.md
  • docs/audits/02-system-map.md
  • docs/audits/03-critical-issues.md
  • docs/audits/04-high-priority.md
  • docs/audits/05-medium.md
  • docs/audits/06-low-priority.md
  • docs/audits/07-refactoring-plan.md
  • docs/audits/08-feature-recommendations.md
  • docs/audits/09-security-trust.md
  • docs/audits/10-testing-gaps.md
  • docs/audits/11-dx-cli-docs.md
  • docs/audits/12-quick-wins.md
  • docs/audits/13-phased-roadmap.md
  • docs/audits/14-top20.md
  • docs/audits/15-file-by-file.md
  • docs/audits/16-verdict.md
  • docs/audits/INDEX.md
  • docs/audits/_findings/T01-architecture.md
  • docs/audits/_findings/T02-security.md
  • docs/audits/_findings/T03-rotation.md
  • docs/audits/_findings/T04-request-pipeline.md
  • docs/audits/_findings/T05-type-safety.md
  • docs/audits/_findings/T06-filesystem.md
  • docs/audits/_findings/T07-concurrency.md
  • docs/audits/_findings/T08-performance.md
  • docs/audits/_findings/T09-observability.md
  • docs/audits/_findings/T10-error-handling.md
  • docs/audits/_findings/T11-config-installer.md
  • docs/audits/_findings/T12-cli-ui.md
  • docs/audits/_findings/T13-test-coverage.md
  • docs/audits/_findings/T14-dependencies.md
  • docs/audits/_findings/T15-ci-release.md
  • docs/audits/_findings/T16-code-health.md
  • docs/audits/_meta/AUDIT-RUBRIC.md
  • docs/audits/_meta/dedup-report.md
  • docs/audits/_meta/environment.md
  • docs/audits/_meta/f1-post-merge-review.md
  • docs/audits/_meta/oracle-review.md
  • docs/audits/_meta/scope-whitelist.txt
  • docs/audits/_meta/severity-reclassifications.md
  • docs/audits/_meta/verification-report.md
  • docs/development/ARCHITECTURE.md
  • docs/development/TESTING.md
  • docs/troubleshooting.md
  • lib/AGENTS.md
  • lib/runtime.ts
  • lib/tools/AGENTS.md
  • lib/tools/_shared.ts
  • lib/tools/codex-export.ts
  • lib/tools/codex-help.ts
  • lib/tools/codex-remove.ts
  • lib/tools/index.ts
  • scripts/install-oc-codex-multi-auth-core.js
  • scripts/install-oc-codex-multi-auth.js
  • test/AGENTS.md
  • test/README.md
  • test/doc-parity.test.ts
  • test/index.test.ts
  • test/install-oc-codex-multi-auth.test.ts
  • vitest.config.ts

Comment thread AGENTS.md Outdated
Comment thread docs/audits/_findings/T04-request-pipeline.md
Comment thread docs/audits/_findings/T10-error-handling.md
Comment thread docs/audits/11-dx-cli-docs.md
@ndycode ndycode merged commit bb2a87f into main Apr 25, 2026
2 checks passed
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