Skip to content

Enforce complete CLI and Console API parity - #1818

Merged
JacobStephens2 merged 3 commits into
issue-1768from
issue-1775
Nov 6, 2026
Merged

JacobStephens2 merged 3 commits into
issue-1768from
issue-1775

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

CLI command and action inventory
  ├─ API twin → registered route → OpenAPI
  └─ CLI-only exclusion → reason → ADR 0026

Adds the remaining Process, Eval, Experiment, email-test and other-account API twins. New Command and subcommand variants fail parity until covered. Exclusions state why they remain in the shell; all twins appear in OpenAPI.

Closes #1775

Test seams

  • The route-table parity check, walking CLI command and subcommand enums.
  • The Console over HTTP compared with the CLI binary, including scope refusals and Console-log attribution.

Evidence

Execution evidence

  • cargo test --bin thirdshift console::parity::every_cli_command_has_an_api_twin_or_reasoned_exclusion -- --exact
    • Before: CLI commands have neither an API twin nor a reasoned exclusion, listing help, version, Eval/Process reads, Experiment starts/rechecks, email-test and other-account changes.
    • After: 1 passed; 0 failed.
  • cargo test --test console api::api_process_show_accepts_cli_single_component_names -- --exact
    • Before: left: 422, right: 200, with name must be a Process name, not a path for the CLI-valid name inspect.v1.
    • After: 1 passed; 0 failed.
  • cargo test --test console start::api_repeated_completed_experiment_is_successful -- --exact
    • Before: left: 422, right: 200, after thirdshift exited with exit status: 0 before a Command record appeared.
    • After: 1 passed; 0 failed.

All three review findings were reproduced as written before disposition. Both behavioral regression tests remain; the site regression is retained in site/tests/pages.test.cjs. The Standards documentation command failed before and exited 0 after:

python3 - <<'PYDOC'
from pathlib import Path
import re
paths = ['site/index.html', 'site/how-it-works/index.html', 'site/architecture/index.html']
missing = []
for path in paths:
    paragraphs = re.findall(r'<p\b[^>]*>.*?</p>', Path(path).read_text(), flags=re.S)
    text = next(p for p in paragraphs if 'POST /api/v1/runs' in p)
    if 'Experiment' not in re.sub(r'<[^>]+>', '', text):
        missing.append(path)
assert not missing, f'API start lists omit the newly supported Experiment command: {missing}'
PYDOC

Validation on final head d9b9c67c: CI passed the full Rust job, formatting, Clippy, site and Console tests. Release builds and smoke checks also passed.

Local scripts/affected-tests 75e023689e636524878122e7b477a499ca1dc013 passed all 66 site tests, all 139 Console browser tests and the locked build. Its Rust run stopped after 1,923 passes and one assertion failure in a_failed_ticket_stops_only_its_dependents_and_is_not_started_again: the call list omitted 21. The exact isolated rerun below passed. A lower-concurrency continuation was deliberately interrupted once CI passed the final head; its SIGINT results are cleanup, not further behavioral failures. The initial full local command did not pass.

cargo test --test spec_run a_failed_ticket_stops_only_its_dependents_and_is_not_started_again -- --exact --test-threads=1

The final Difficulty schema correction passed these focused checks, then Clippy again:

cargo test --test console api::openapi_equals_cli_and_describes_operations_without_local_secrets -- --exact
cargo test --test console experiments::api_experiment_changes_and_rechecks_match_cli_views -- --exact

The CLI schema assertion failed before with AssertionError: {'type': 'object'} and passed afterward:

target/debug/thirdshift console openapi | python3 -c 'import json,sys; schema=json.load(sys.stdin)["paths"]["/api/v1/experiments/{id}/difficulty"]["post"]["responses"]["200"]["content"]["application/json"]["schema"]; assert schema["type"] == "array", schema'

Visual evidence

The changed API-start paragraphs, with their containing sections expanded, at matching viewports and states:

Home — 1440×900

Before

After

Home — 390×844

Before

After

How it works — 1440×900

Before

After

How it works — 390×844

Before

After

Architecture — 1440×900

Before

After

Architecture — 390×844

Before

After

Merge Danger

Door: two-way

Adds scoped HTTP twins and a parity guard; no storage migration. Existing CLI functions continue to perform the work.

Blast Radius: Console

The new routes expose additional read, act, run and admin capabilities under the existing authorization and audit middleware.

Unaddressed findings

Standards

None. STD-1775-01 fixed; 1 finding raised, 0 skipped.

Spec

None. SPEC-1775-01 and SPEC-1775-02 fixed; 2 findings raised, 0 skipped.

Security

None.

Security review outcome

No unaddressed introduced findings.

Review coverage

Independent Standards and Spec reviews used the issue-1768 remote tip pinned at 75e023689e636524878122e7b477a499ca1dc013, then reviewed the fixes. Both read all 20 changed files through the review-fix commit d860c414. A subsequent self-checked correction makes Difficulty responses arrays in OpenAPI and adds a regression assertion. Its final hunks in src/console/openapi.rs and tests/console/api.rs were not read by the reviewers. No other unread changes; generated-output exclusions: none.

Built with codex codex-cli 0.164.0 · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 merged commit 816e640 into issue-1768 Nov 6, 2026
16 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1775 branch November 6, 2026 10:42
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