Skip to content

docs+fix: ATLAS-CONTRACT.md v1.1.0 + fix two wrong atlas calls in doctor.zsh#468

Draft
Data-Wise wants to merge 2 commits into
devfrom
feature/atlas-contract-v1.1
Draft

docs+fix: ATLAS-CONTRACT.md v1.1.0 + fix two wrong atlas calls in doctor.zsh#468
Data-Wise wants to merge 2 commits into
devfrom
feature/atlas-contract-v1.1

Conversation

@Data-Wise

Copy link
Copy Markdown
Owner

Summary

  • Task 1: Bump docs/ATLAS-CONTRACT.md from v1.0.0 to v1.1.0, documenting the 5 new atlas v0.9.3 integration flags and correcting the output-format section from a false universal-flag claim to a per-command support matrix.
  • Task 2: Fix two out-of-spec atlas calls in commands/doctor.zsh that would silently fail for any user with atlas installed (OOS-1: atlas config get backendatlas config show; OOS-2: atlas mcp statuscommand -v atlas-mcp).

Changes

docs/ATLAS-CONTRACT.md (v1.0.0 → v1.1.0)

  • Version Compatibility table: added row for flow-cli v7.10.x ↔ atlas v0.9.3 with a summary of the 5 new flags.
  • Parties line: updated to v7.10.x / v0.9.3.
  • Warm Path Commands table: added atlas session status row (previously absent entirely); added atlas trail --limit <n> row.
  • Required Commands table: added atlas inbox --count row alongside existing atlas inbox.
  • Output Format Specifications: replaced the incorrect "4 formats via a universal --format flag" claim with a per-command support matrix:
    • project list: table | json | names
    • project show: table | json | names | shell
    • session status: table | json (NEW)
    • stats: table | json | text | md
    • session export: ical | json
    • plan: --json flag (not --format)
  • New contract sections: detailed output semantics for each of the 5 new flags (session status --format=json, project list --count, project list --suggest, inbox --count, trail --limit).

commands/doctor.zsh

  • OOS-1 (atlas config get backend): atlas config has no get subcommand. The correct command is atlas config show, which emits JSON containing a storage field (the backend). Fixed to atlas config show | jq -r '.storage' with a grep/sed fallback when jq is absent. Diagnostic remains non-fatal.
  • OOS-2 (atlas mcp status): atlas has no mcp subcommand. The MCP server is a separate binary atlas-mcp (declared in atlas's package.json bin). Fixed to command -v atlas-mcp. Message updated to "atlas-mcp binary available" vs "(optional MCP server, not installed)".

Decision recorded

The task brief noted these as pre-approved fixes. No behaviour changes to flow-cli's hot-path; both doctor checks are non-fatal diagnostics.

Test plan

  • source flow.plugin.zsh && doctor — atlas integration section should show backend from config show instead of erroring
  • doctor with atlas installed but jq absent — sed fallback produces same result
  • doctor with atlas not installed — section still shows "optional, not installed" gracefully
  • doctor output references "atlas-mcp binary available" / "optional MCP server, not installed" (no longer calls atlas mcp status)
  • ./tests/run-all.sh — no regressions (doctor tests are non-interactive, should still pass)

https://claude.ai/code/session_01FuHPHhpeCDgcowKPnG2F4V


Generated by Claude Code

ATLAS-CONTRACT.md (v1.0.0 → v1.1.0):
- Add Version Compatibility row: flow-cli v7.10.x ↔ atlas v0.9.3
- Document 5 new contracted flags (session status --format, project list
  --count, project list --suggest, inbox --count, trail --limit)
- Add `atlas session status` to Warm Path Commands table
- Replace universal --format claim with per-command support matrix
  (project list: table|json|names; project show: +shell; session status:
  table|json; stats: table|json|text|md; session export: ical|json)
- Add contract sections for each new flag with exact output semantics
- Update Parties line to v7.10.x / v0.9.3

commands/doctor.zsh (OOS-1, OOS-2):
- OOS-1: replace `atlas config get backend` (non-existent subcommand)
  with `atlas config show | jq '.storage'` (with grep/sed fallback)
- OOS-2: replace `atlas mcp status` (non-existent subcommand) with
  `command -v atlas-mcp` (atlas-mcp is a separate binary declared in
  atlas package.json bin, not an atlas subcommand)

Co-Authored-By: Claude (scheduled agent) <noreply@anthropic.com>
@Data-Wise Data-Wise changed the base branch from main to dev June 14, 2026 13:00
… parse; document config show

Addresses the adversarial review of the atlas-contract-v1.1 changes. Verified
against atlas source (bin/atlas.js:1122 — config show emits JSON.stringify(cfg,
null, 2); package.json bin — atlas-mcp is a separate binary), so the OOS-1/OOS-2
fixes are confirmed correct. Remaining issues fixed:

- doctor.zsh: '✓ connected' fired whenever 'command -v atlas' succeeded, so a
  broken/half-installed atlas (e.g. bad interpreter shebang) was reported as
  connected. Now gated on 'atlas config show' actually returning output; a
  non-responding atlas shows '⚠ installed but not responding'. Verified against
  the local broken atlas.
- doctor.zsh: anchored the no-jq .storage parse on the "storage" key so it
  doesn't greedily capture the last quoted value (wrong for compact JSON).
- ATLAS-CONTRACT.md: documented 'atlas config show' (which doctor.zsh depends on)
  — full config as pretty JSON, '.storage' is the backend (filesystem|sqlite),
  no 'atlas config get' subcommand exists.
- tests/test-doctor-atlas-calls.zsh: static spec-compliance regression guard
  (no working-atlas/jq dependency); registered in run-all.sh.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Data-Wise pushed a commit that referenced this pull request Jun 14, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Data-Wise

Copy link
Copy Markdown
Owner Author

Fixes pushed (e7eb6cb7) + adversarial review notes

Ran an adversarial review of this branch and pushed fixes directly to it. First verified the two doctor.zsh OOS fixes against atlas source — both are correct, so I left that logic untouched:

  • OOS-1 ✅atlas config show does emit JSON (bin/atlas.js:1122console.log(JSON.stringify(cfg, null, 2))) and .storage is the backend (filesystem | sqlite). atlas config get genuinely doesn't exist, so the old call was broken as you described.
  • OOS-2 ✅atlas-mcp is a separate binary (package.json bin), so command -v atlas-mcp is the right check (it's an on-demand stdio server — "installed" is the sensible signal).

What I changed

  1. False-positive "connected" (pre-existing) — doctor printed ✓ atlas connected whenever command -v atlas succeeded, so a broken/half-installed atlas (e.g. a bad interpreter shebang) reported as connected. Now gated on atlas config show actually returning output. Reproduced + fixed against a real broken local atlas:
    ✓ atlas installed (vunknown)
    ⚠ atlas installed but not responding (config show failed)   ← was "✓ connected (filesystem backend)"
    ✓ atlas-mcp binary available
    
  2. Hardened the no-jq .storage parse — anchored on the "storage" key. The prior sed 's/.*: *"..."/\1/' greedily grabs the last quoted value, so on compact JSON it returns the wrong field ({"storage":"filesystem","other":"db"}db). Doesn't bite today (atlas pretty-prints) but it's a latent trap.
  3. Documented atlas config show in ATLAS-CONTRACT.md — the code depends on it, but the contract only covered session/list/inbox/trail. Added the JSON shape, .storage, and the "no config get" note.
  4. tests/test-doctor-atlas-calls.zsh — static spec-compliance guard (needs no working atlas or jq; runs on any CI runner), registered in run-all.sh. 5/5.

Heads-up

  • This branch is based on old main (477b5c59), so it predates the CI-gate test helpers (skip_without_warm_atlas, run-all.sh rc-77) now on dev — that's why the new test is fully self-contained. Worth a rebase onto dev before merge.
  • It's your PR — left it as a draft for you to mark ready / merge.

🤖 Generated with Claude Code

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