Skip to content

refactor(cli): isolate schema lifecycle and lint execution - #1044

Closed
aaltshuler wants to merge 13 commits into
ModernRelay:mainfrom
aaltshuler:codex/cli-schema-boundary
Closed

aaltshuler wants to merge 13 commits into
ModernRelay:mainfrom
aaltshuler:codex/cli-schema-boundary

Conversation

@aaltshuler

Copy link
Copy Markdown
Contributor

What & why

Schema, initialization and lint commands currently panic if stdout closes while printing their result. Move their arguments and execution into commands/schema and use fallible, supplied output writers, so delivery failures return through application completion. Schema apply retains its existing write evidence and reconciliation guidance after publication; init and system-column upgrade keep their own execution paths and do not acquire an unsupported data-write outcome envelope.

The slice covers init, schema plan/apply/show/upgrade-system-columns, and lint. Public syntax, aliases, successful output and report exit statuses remain unchanged. It preserves cluster ownership checks before init/apply source reads, direct-only schema apply, actor attribution, read-only planning, offline lint without target resolution, query-before-schema reads, and the upgrade adapter's separate check/execution opens. No new commands, flags, dependencies, storage changes or retries.

Backing issue / RFC

The draft coherency RFC in #675 supplies refactor sequencing; this does not introduce its proposed targeting grammar.

Checklist

  • Change is focused on schema/lifecycle execution and delivery
  • Existing formatter, application, schema, cluster and lint test owners extended
  • User/developer guides and permanent release note updated
  • Architectural invariants reviewed; publication, admission, policy and retry boundaries preserved

Local verification

  • Clean baseline: env CARGO_TARGET_DIR=/Users/andrew/code/omnigraph/target CARGO_BIN_EXE_omnigraph-server=/Users/andrew/code/omnigraph/target/debug/omnigraph-server cargo test -p omnigraph-cli --locked — 522 passed, 19 ignored.
  • Same full CLI command after refactor — 527 passed, 19 ignored, including the existing real-server integration suite.
  • cargo clippy -p omnigraph-cli --all-targets --locked -- -D warnings -W clippy::dbg_macro — passed.
  • cargo fmt --all --check, python scripts/check-docs.py in the existing documentation environment (316 files), targeted typos, and git diff --check — passed.
  • Baseline/current binaries: all 106 help/argument cases and 33 schema/lint/lifecycle cases matched exit status, stdout and stderr exactly, without normalization.
  • Seven closed-stdout process cases (init, schema apply human/JSON, successful/failed lint human/JSON): baseline panic/exit 101 becomes normal failure/exit 1. State inspection confirms durable initialization, exactly one schema publication, and no graph changes from lint.
  • Whole-workspace, GQT and cloud suites not run locally for this CLI-only slice. Compiler semantics and engine/storage implementation are unchanged.

Notes for reviewers

Depends on #1043 at 8b22f35350a6ea6ef6dca4f920b79bfbcdfbb2c9, still open. This slice is commit 1d758e63; predecessor commits remain in the PR until that stack lands.

Stored-query registry commands remain with the cluster control boundary: they consume an applied deployment snapshot rather than standalone schema files. No test fixture or parallel semantic test suite was added.

@aaltshuler

Copy link
Copy Markdown
Contributor Author

Superseded by #1047, which merged the complete CLI refactor, its delivery and configuration fixes, and the latest main integrations as 02026b5. Closing this incremental slice because its implementation is now on main.

@aaltshuler aaltshuler closed this Oct 17, 2026
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