Repository navigation
feat: squabbler product into the RSR shell (Rust workspace + SPARK-proved invariant) - #2
Merged
Merged
Conversation
…oved invariant)
Grafts the v0.1 squabbler onto the template-instantiated repo (keeps the RSR
shell: .github CI, devcontainer, governance, AFFIRMATION, etc.).
- crates/{squabble-core,squabble-cli,squabble-app}: fight engine (7 tests pass),
'squabble diagnose' CLI, honest GitHub-App stub.
- spark/Gate_Machine: gnatprove proves green ⇔ (non-empty ∧ all required checks
passed) — squabble≠bypass as a machine-checked invariant.
- Filled CLADE/ANCHOR/ECOSYSTEM identity (was template placeholder) + Trust
contractile (squabble≠bypass) + product README + docs/CHARTER.adoc.
- Justfile: wired build→cargo, test→cargo test (was a TODO false-green echo),
added prove→gnatprove + demo.
Remaining instantiation-completion (follow-up): regenerate CLAUDE.md per-repo
section (still shows rsr-template-repo), fill remaining substrate placeholders,
READINESS grade. The template's generic src/ aspect docs are left in place.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
hyperpolymath
enabled auto-merge (squash)
June 29, 2026 13:15
10 tasks done
hyperpolymath
added a commit
that referenced
this pull request
Jul 9, 2026
…oning (Push #2) (#13) ## Summary Push #2: wire the army and make the squabbler **summonable**, while the core stays detachable and every hand-off stays honest. Three pieces: 1. **`squabble-fight` (new crate)** — the host-side fight brain extracted from `squabble-cli` (`git mv` preserves history): ecosystem-context reader + workflow ground-truth + the pure planner (`plan` / `plan_at_root`). The CLI and the App now serve **one** planner and cannot drift. 2. **`squabble-app`: stub → real** — a loopback-only axum server on `127.0.0.1:${SQUABBLE_PORT:-7741}`: `GET /health`, `POST /api/v1/diagnose` (Gate → Diagnosis), `POST /api/v1/fight` ({slug, gate, repo_root?} → Outcome/Report manifest). This is the process the boj-server `cicd-squabbler-mcp` cartridge proxies to (cartridge gateways are Deno-sandboxed with `--allow-net` only — no subprocess — so the squabbler must be reachable over loopback HTTP). The GitHub App *webhook* leg remains **honestly absent**: no webhook route is registered; a delivery 404s rather than faking a 200. 3. **`squabble fight --summon`** (feature `boj`, `ureq`; the default build compiles the client out and gains **zero deps**) — maps each `EscalateToExpert` to its specialist cartridge over boj-server's documented invoke contract: Security→`panic-attack-mcp/panic_attack_scan`, Proof→`echidna-llm-mcp/consult`, Hypatia*→`hypatia-mcp/hypatia_scan_repo`. **Honest actuation:** dispatch-fix is recorded as *assessed, actuation external* (no fixer cartridge exists today) — never "a PR was opened". **Fail-closed:** unreachable server/expert appends explicit evidence to every escalation; a summon can only *add* evidence, never remove/downgrade an escalation or change the outcome colour; a build without the feature refuses `--summon` loudly (exit 2). `squabble-core` change is additive-only: `Diagnosis` gains `Serialize/Deserialize`. No engine semantics changed; the SPARK-mirrored gate invariant is untouched. Companion PR: `hyperpolymath/boj-server-cartridges` — the `cicd-squabbler-mcp` cartridge (same branch name). ## Changes - `crates/squabble-fight/` (new): `context.rs`, `workflows.rs` (moved), `lib.rs` (planner + `plan_at_root` + tests) - `crates/squabble-app/`: axum loopback server (replaces exit-69 stub; refuses non-loopback bind; exits 69 on bind failure) - `crates/squabble-cli/`: thin `fight.rs` (delegates to shared planner; `--summon`), `boj.rs` (feature-gated client + routing + fail-closed summon), feature `boj = ["dep:ureq"]` - `crates/squabble-core/src/lib.rs`: serde derives on `Diagnosis` - `.machine_readable/descriptiles/STATE.a2ml`: milestones + next-actions updated (App backend + boj client + cartridge shipped; `--apply`/webhook leg + live-fire with deployed experts remain open) ## RSR Quality Checklist ### Required - [x] Tests pass (`cargo test --workspace` — 42 tests; plus boj-feature tests) - [x] Code is formatted (`cargo fmt --check` clean) - [x] Linter is clean (`cargo clippy --workspace --all-targets`, both feature configs — no warnings) - [x] No banned language patterns (Rust only; JS gateway lives in the cartridge repo per its own policy) - [x] No `unsafe` blocks without `// SAFETY:` comments (none added) - [x] No banned functions (`believe_me`, `unsafeCoerce`, `Obj.magic`, `Admitted`, `sorry`) - [x] SPDX license headers present on all new/modified source files (MPL-2.0) - [x] No secrets, credentials, or `.env` files included ### As Applicable - [x] `.machine_readable/descriptiles/STATE.a2ml` updated - [x] New dependencies reviewed for license compatibility: `axum`/`tokio` (App only — the App *is* the host server), `ureq` (feature-gated, off by default) — all MIT/Apache-2.0, MPL-compatible; **`squabble-core` gained no dependencies** (detachability preserved) ## Testing - `cargo test --workspace` green (default + `--features boj`); fmt + clippy clean in both configs. - **Live end-to-end:** ran `squabble-app`, then `curl` as the cartridge would — `/health` OK; `/api/v1/diagnose` returned the pure Diagnosis; `/api/v1/fight` over the real ipv6-only checkout returned the full manifest (and correctly **no longer flags the AGPL label that ipv6-only#45 removed** — the loop observes its own completed work). - **`--summon` degradation:** against a dead port, every escalation gained explicit `expert unreachable — escalation stands, fail-closed` evidence (nothing dropped, colour unchanged); the default build refused `--summon` loudly with exit 2. - A multi-angle code review ran on this diff; findings are being applied as a follow-up commit on this branch (typed expert verdicts instead of evidence-string splicing, fail-loud `SQUABBLE_PORT` parsing, minor simplifications). **Notes:** commits from this environment are unsigned (no signing key provisioned — owner/CI to sign). `gnatprove` runs in CI; the SPARK files are untouched. Live `--summon` value depends on the expert backends (hypatia :7701, panic-attack, echidna) actually being deployed — today's wiring proves the contract + graceful degradation. ## Screenshots n/a (terminal transcripts above). --- _Generated by [Claude Code](https://claude.ai/code/session_01SUURnQUnzTXYftzWFs5pfZ)_
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Grafts the v0.1 squabbler onto the template-instantiated repo, keeping the RSR shell (CI, devcontainer, governance).
Product
crates/squabble-core— fight engine, 7 tests pass (cargo test).crates/squabble-cli—squabble diagnose <gate.json>works.crates/squabble-app— honest GitHub-App stub (axum/octocrab = next step, not faked).spark/Gate_Machine— gnatprove provesgreen ⇔ (non-empty ∧ all required checks passed): squabble≠bypass as a machine-checked invariant.Substrate — filled CLADE/ANCHOR/ECOSYSTEM identity (was template placeholder), Trust contractile (squabble≠bypass), product README +
docs/CHARTER.adoc. Wiredjust build/testto real cargo (the template stub echoed a false green — fixed per fail loudly); addedjust prove/demo.Verify:
just test(7 pass) ·just prove(postcondition proved) ·just demo.Follow-up (instantiation-completion): regenerate the per-repo
CLAUDE.mdsection (still says rsr-template-repo), fill remaining substrate placeholders, set a READINESS grade. Clade uuid provisional (owner ratifies via gv-clade-index).🤖 Generated with Claude Code