fix: resolve 13 red-team CLI bugs (6 P0, 3 P1, 4 P2)#99
Conversation
Closes #62 P0 trust/correctness: - Resolve relative source_dir/build_dir against pipeline file, not cwd (#3) - Clear synix_dir on --build-dir override to prevent stale routing (#4) - Propagate source load failures instead of silently succeeding (#5) - Add Layer.level read-only property to fix info crash (#8) - Rewrite info/status to read .synix/ snapshot store, not legacy build/ (#9) - Diff uses RefStore run history instead of legacy versions/ dir (#11) P1 operator consistency: - Planner uses estimated-count placeholders for downstream cardinality (#1) - Standardize invalid ref handling to sys.exit(1) across all inspectors (#10) - Clean also removes refs/releases/ ref files (#12) P2 docs/discoverability: - Mesh commands honor SYNIX_MESH_ROOT env var via resolve_mesh_root() (#2) - Batch planner tracks DAG cardinality instead of estimate_output_count(1) (#6) - Fix llms.txt diff syntax to match actual CLI (#7) - Add refs/plans to refs list prefix scan (#13)
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary This PR is a hardening pass fixing ~10 bugs across path resolution, error handling, legacy code removal, and planning accuracy. Key changes: (1) resolve relative Alignment Strong alignment. The Observations
Verdict This is a solid housekeeping PR that removes legacy code paths, fixes real user-facing bugs, and adds strong test coverage — a good incremental step toward a consistent Review parameters
|
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Moderate risk: mostly bugfixes, but it quietly changes path semantics, CLI behavior, and release/ref cleanup in ways users will depend on. One-way doors
Findings
Missing
Verdict — Ship with fixes: the bugfixes are real, but there are contract drifts and brittle heuristics that should be tightened before this becomes user-facing behavior. Review parameters
|
The absolute path resolution change (Bug 3) produces different-length paths between local and CI, causing Rich panel padding to differ. Collapse variable-width padding before trailing │ in _normalize_output() so golden comparisons are terminal-width-independent.
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary This PR is a hardening pass fixing ~10 bugs across path resolution, error handling, legacy code removal, and planning accuracy. Key changes: relative paths now resolve against pipeline file location, source load failures are surfaced properly (hard error in build, error status in plan), Alignment Strong alignment. The Observations
Verdict This is a solid incremental step — it completes the Review parameters
|
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Medium risk: this is a grab-bag of behavioral fixes, but it quietly changes CLI semantics, path resolution, failure handling, and release cleanup in ways that can break existing workflows. One-way doors
Findings
Missing
Verdict — Ship with fixes: several changes are reasonable, but the CLI/documentation mismatch, fragile diff predecessor logic, and adapter-leaking release/status logic should be corrected before merge. Review parameters
|
- diff.py: use None-safe created_at (omit field if missing instead of fabricating datetime.now()); add comment clarifying ref iteration order - batch_runner.py: log warning on source load failure instead of silently defaulting cardinality to 1 - info_commands.py: use layer.level property instead of _level
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Medium risk: mostly bug-fix territory, but it changes CLI behavior, path resolution, plan semantics, and release/ref cleanup in ways that can silently break existing workflows. One-way doors
Findings
Missing
Verdict — Ship with fixes: the bug fixes are useful, but the CLI contract drift, fragile diff ordering, and planner/batch estimation shortcuts need cleanup before this calcifies into user-facing behavior. Review parameters
|
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary This PR is a housekeeping and correctness sweep fixing ~10 discrete bugs: path resolution for relative Alignment Strong alignment. The Observations
Verdict This is a well-scoped correctness sweep that removes legacy code paths, improves error handling, and strengthens the Review parameters
|
Path resolution (Bug 3 follow-up): - Resolve per-Source dir= overrides against pipeline file location - Stop passing raw --source-dir to runner/planner; pipeline.source_dir is already resolved - Add tests for Source(dir="./custom") and --source-dir CLI override Info/status discovery (Bug 9 follow-up): - Info now loads pipeline.py to discover non-default build_dir locations - Replace hard-coded search.db/context.md checks with dynamic file enumeration in release directories Clean coverage (Bug 12 follow-up): - Warn about external release targets that won't be cleaned
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Medium risk: this PR fixes real regressions, but it also quietly changes CLI behavior, path semantics, and cleanup behavior in ways users will depend on. One-way doors
Findings
Missing
Verdict — Ship with fixes: the bug fixes are legitimate, but the CLI/documentation drift and brittle history/ref logic should be cleaned up before merge to avoid cementing bad semantics. Review parameters
|
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary This PR fixes a cluster of path resolution, error handling, and legacy-removal bugs across the CLI, planner, runner, diff engine, and info/status commands. It resolves relative paths against pipeline file location, makes source load failures hard errors during build, adds snapshot-era diff support, migrates info/status off legacy Alignment Strong alignment. The migration of Observations
Verdict This is a solid hardening PR that fixes real usability bugs, completes the legacy-to-snapshot migration in CLI commands, and ships with thorough test coverage — a good incremental step. Review parameters
|
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Moderate risk: this PR fixes real inconsistencies, but it also changes path resolution, failure semantics, and cleanup behavior in ways that can silently break existing workflows. One-way doors
Findings
Missing
Verdict — Ship with fixes: the bugfixes are valid, but the behavior changes around path resolution, source failure policy, and cleanup need documentation and a couple of design corrections before this calcifies. Review parameters
|
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary This PR is a housekeeping and correctness sweep: it fixes path resolution so pipelines work when invoked from outside their directory, improves error handling for failed sources and invalid refs, modernizes Alignment Strong alignment. The path resolution fix ( Observations
Verdict This is a solid correctness and consistency sweep that fixes real usability bugs (path resolution, silent failures, stale legacy code paths) while maintaining strong alignment with the Review parameters
|
Release refs still point at valid snapshot OIDs after payloads are cleaned. The release can be re-materialized from the ref. Ref deletion should be an explicit operation, not a side effect of clean.
|
Note Red Team Review — OpenAI GPT-5.4 | Adversarial review (docs + diff only) Threat assessment — Medium risk: mostly bug-fix territory, but it quietly changes path semantics, CLI surface area, and failure behavior in ways users will depend on. One-way doors
Findings
Missing
Verdict — Ship with fixes: the bug fixes are sensible, but the CLI removal and undocumented semantic changes around path resolution and source failures are not clean enough to merge as-is. Review parameters
|
|
Note Architectural Review — Claude Opus | Blind review (docs + diff only) Summary — This PR is a cleanup and correctness batch: it fixes path resolution so relative dirs resolve against the pipeline file (not cwd), hardens error handling for source load failures and invalid refs, replaces the legacy Alignment — Strong fit with the vision. Path resolution against the pipeline file (not cwd) is essential for the "Python-first, pipelines are code" model from DESIGN.md §4.1. Promoting source load failures to hard errors in Observations
Verdict — This is a solid hardening PR that fixes real correctness bugs (path resolution, cardinality estimation, error propagation) while retiring legacy code paths in favor of the snapshot-era architecture. Good incremental step. Review parameters
|
Closes #62
Summary
Fixes all 13 bugs identified in the red-team sweep (
docs/red-team-prioritized-bug-report-2026-03-10.md), organized by priority:P0 — Trust/Correctness (6 bugs)
source_dir/build_diragainst the pipeline file location, not the caller's cwdpipeline.synix_dirwhen--build-diris overridden so snapshots route to the correct.synix/status="error") instead of silently producing empty builds with exit code 0Layer.levelread-only property — fixessynix infocrash (AttributeError: 'Source' has no attribute 'level')info/statusto read.synix/snapshot store and.synix/releases/instead of legacybuild/pathssynix diffusesRefStorerun history to find previous snapshots instead of checking non-existent legacybuild/versions/directoryP1 — Operator Consistency (3 bugs)
ReduceSynthesislist,search,show,lineage) now exit non-zero with[red]Cannot open snapshot[/red]messagesynix cleanalso removesrefs/releases/ref files, not just release payloadsP2 — Docs/Discoverability (4 bugs)
SYNIX_MESH_ROOTenv var via newresolve_mesh_root()helperestimate_output_count(1)llms.txt— replace unsupportedsynix diff <ref-a> <ref-b>with actual CLI syntaxrefs/planstorefs listprefix scan so saved plan refs are visibleNew tests (5 files, 17 tests)
tests/e2e/test_path_resolution.py— absolute-path pipeline,--build-diroverride, info/status with.synix/tests/e2e/test_source_load_failure.py— build exits non-zero, plan reports error statustests/e2e/test_diff_snapshot_era.py— diff across runs, single-run returns Nonetests/e2e/test_invalid_ref_consistency.py— all 4 inspector commands fail consistently on bad refstests/unit/test_info.py—Layer.levelproperty +compute_levelsintegrationTest plan
uv run ruff check— all cleanuv run pytest tests/ -x— 1937 tests pass