Skip to content

fix(cli): parse inspect options before checking diagram type - #829

Open
rudycelekli wants to merge 1 commit into
tt-a1i:devfrom
rudycelekli:fix/inspect-option-order
Open

rudycelekli wants to merge 1 commit into
tt-a1i:devfrom
rudycelekli:fix/inspect-option-order

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem and value

archify inspect --json architecture input.json fails with cli/unsupported-option and reports --json as the diagram type. The shared validate parser already supports options before positionals, but inspect checks raw argv first.

Check inspect's architecture-only restriction after the shared parser extracts the positional type. The committed regressions protect leading --json and --quality options through the same parser. Leading --repo-root was separately exercised through the actual public CLI in the verification below; that manual proof is not described as a new committed regression.

AI assistance and accountability

  • AI use: implementation, investigation, tests, and description writing.
  • Tools and model: Codex (model gpt-6.1-sol) investigated the source, wrote the change and its tests, ran the checks reported below, and drafted this description. Claude Code (Claude Opus) rebased the change onto current dev on 2026-10-24, re-ran the focused checks listed under Rebase onto current dev, and edited this description.
  • Accountable contributor: @rudycelekli
  • Problem origin: code inspection; a reproducible defect found by reading the current source, not an observed production or Agent failure.
  • I reviewed the submitted changes and explanation, understand their impact, and can answer questions about them. Validation results and gaps are recorded below.

Stability impact

  • Local CLI behavior: inspect delegation to validate.
  • Architecture-only inspect, workflow rejection, structured argument receipts, and existing layout output remain intact.
  • Applied test-value: regression checks successful public layout output and correct workflow failure attribution. Focused simplify review removed the duplicate pre-parser type decision; no additional abstraction needed.

Tests run

Original comparison base: 0b8f9f341760662bad37a6ff4716877220a8dedc. Verified current candidate: de39d662c84ff1f3dd5d9873ee384dc7761ec137.

  • Official Node 22.23.2: node scripts/run-tests.mjs --require-files --test-name-pattern=cli: inspect test/cli.test.mjs — 5 passed, 0 failed, 0 skipped.
  • The runtime executes five matching inspect cases: the ENOBUFS inspection case is registered dynamically and is easy to miss when counting static declarations. All five passed. A separate actual public CLI invocation with leading --repo-root, architecture, the real web-app fixture and trailing --json also exited 0 with component/connection layout output. This establishes the leading repo-root claim without claiming a new committed regression.
  • Matching-head upstream CI: 20 successful checks and 2 scope/deployment skips; no failed or pending check in the refreshed rollup. Source is unchanged by this evidence update.

Generated artifacts

Rebuilt archify.zip from staged tracked sources using official Node 22.23.2 and bundled zlib 1.3.1-e00f703. The first staging attempt encountered local ENOSPC and cleaned its temporary stage; a retry succeeded. No Gallery, website, version, or release change.

Rebase onto current dev

The branch conflicted with dev. It is now rebuilt as one commit on dev 82c7e0f089a02a4d514714adf37dc2061682da5f: head ae094d8125a72797ea40d89144550ac1bdec27f4, previously de39d662c84ff1f3dd5d9873ee384dc7761ec137. The source and test diff is unchanged. archify.zip was rebuilt from the combined source with official Node 22.23.2 (zlib 1.3.1-e00f703). Before applying the change, scripts/build-zip.sh on unmodified dev reproduced the committed archive byte for byte.

node --test --test-name-pattern='cli: inspect' test/cli.test.mjs: 5 passed, 0 failed. With archify/bin/archify.mjs reverted to dev, the added test fails.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: tt-a1i/archify
  • Branch: dev
  • File: .coderabbit.yaml
  • Commit: 82c7e0f
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0e92d2b6-9b74-44c3-b2e0-4415b37c0000
Commits

Reviewing files that changed from the base of the PR and between de39d66 and ae094d8.

Files ignored due to path filters: 1
  • archify.zip is excluded by !**/*.zip
Files selected for processing: 1
  • archify/bin/archify.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Summary

At reviewed base 0b8f9f341760662bad37a6ff4716877220a8dedc, inspect could mistake a leading option such as --json for the diagram type. At reviewed head de39d662c84ff1f3dd5d9873ee384dc7761ec137, it parses shared options before enforcing the architecture-only restriction. Architecture inspection accepts leading --json and --quality; workflow inspection remains unsupported. The author reports five matching tests passed on Node 22.23.2. Observed CI for the reviewed head completed successfully, with 20 successful checks and two deployment skips. This summary records that snapshot, not live CI status.

The inspect command now validates its diagram type in commandValidate after shared option parsing. The dispatcher no longer checks the first argument directly. CLI tests cover options before the architecture type and verify that workflow returns a structured unsupported-option diagnostic.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: Minimal · up to ae094

No concrete merge-blocking risk is identified in the reviewed change.

Pre-merge checks: Passed 1 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Validation Evidence Warning The regression scope is covered, but the evidence report is not accurate for the reviewed revision. The review refs are base 82c7e0f and head ae094d8, while the PR body reports base 0b8f9f3 and … Update the PR body to identify the reviewed base/head (82c7e0f/ae094d8) or provide a check result tied to the actual final head. Correct the focused command to quote the pattern, for example --test-name-pattern='cli: inspect', then re…
Passed Passed checks: 1 passed
Check name Status Explanation
Contribution Scope Passed The PR describes a concrete user problem and a focused CLI behavior fix. The change moves the existing architecture-only inspect check after shared option parsing, adds targeted regression coverage …
Full details: Contribution Scope

Explanation

The PR describes a concrete user problem and a focused CLI behavior fix. The change moves the existing architecture-only inspect check after shared option parsing, adds targeted regression coverage for leading --json and --quality, and preserves workflow rejection and structured receipts. The description records compatibility and failure behavior, test results, and generated-artifact handling. No broad contract, default, migration, or product-scope change requires a linked issue.

Full details: Validation Evidence

Explanation

The regression scope is covered, but the evidence report is not accurate for the reviewed revision. The review refs are base 82c7e0f and head ae094d8, while the PR body reports base 0b8f9f3 and candidate de39d66; those candidate trees differ. The reported focused command also omits quotes around cli: inspect. The repository runner would parse inspect as a test-file argument and reject it. Static source evidence supports five matching cases only for the quoted pattern: four literal cli: inspect tests plus the dynamic renderer-ENOBUFS case. The added regression covers leading --json and --quality; --repo-root remains an author-reported manual check, not a committed regression. archify.zip does contain the current archify/bin/archify.mjs, so artifact freshness is supported.

Resolution

Update the PR body to identify the reviewed base/head (82c7e0f/ae094d8) or provide a check result tied to the actual final head. Correct the focused command to quote the pattern, for example --test-name-pattern='cli: inspect', then rerun it on that head and report its five-case result. Keep the --repo-root statement explicitly labeled as manual unless adding a committed regression for it.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR

@rudycelekli
rudycelekli marked this pull request as ready for review October 10, 2026 17:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 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-10-10T18:03:38.005485Z de39d66 Draft marked ready
ℹ️ 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.

@rudycelekli

Copy link
Copy Markdown
Contributor Author

Refreshed the description against the current head de39d662c84ff1f3dd5d9873ee384dc7761ec137 and corrected stale revision/count attribution. The runtime executes five matching inspect cases: the ENOBUFS inspection case is registered dynamically and is easy to miss when counting static declarations. All five passed. A separate actual public CLI invocation with leading --repo-root, architecture, the real web-app fixture and trailing --json also exited 0 with component/connection layout output. This establishes the leading repo-root claim without claiming a new committed regression.

The focused result is 5 passed, 0 failed, 0 skipped on Node 22.23.2; the matching-head upstream checks have no failures or pending jobs.

@rudycelekli
rudycelekli force-pushed the fix/inspect-option-order branch from de39d66 to ae094d8 Compare October 24, 2026 04:16

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Agent-assisted technical review; this pass reuses the identified earlier evidence, with no new local test run.

The inspect fix is technically sound at ae094d8125a72797ea40d89144550ac1bdec27f4. Checking the architecture-only restriction after the shared parser removes the flag-ordering bug without expanding inspect’s supported diagram types. The independent same-head focused comparison passed 5 cases and failed the added regression on base; that evidence remains applicable because the head is unchanged. Currentdev still contains the raw args[0] check. The red CI result is the old README signal-flow artifact drift, separate from inspect. Please integrate current dev with the author history intact, rebuild the combined package and verify final-head checks; do not add another option parser or repeat the unchanged full suite simply to restate the earlier result.

The contributor's personal-review confirmation remains unchecked. Please complete it before final acceptance; the technical conclusion above does not claim human sign-off.

This branch has not been deployed

No deployments
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.

2 participants