Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brave-rivers-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hashintel/brunch": minor
---

Add isolated Brunch and Petrinaut brownfield comparison cases.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
git config --global user.name "Brunch CI"
git config --global init.defaultBranch main

- name: Install native test dependencies
run: |
sudo apt-get update
sudo apt-get install --yes expect ripgrep zsh

- name: Install
run: npm ci

Expand Down
27 changes: 16 additions & 11 deletions .pi/prompts/compare-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ For a supplied or selected id, run:
npx tsx src/dev/execution-comparison-operator.ts inspect --case <case-id>
```

This is the only pre-approval case read. It validates the existing FE-1230 public case loader and returns only the exact frozen specification, exact public contract, hashes, and shared framing. If resolution or validation fails, report the error and stop; never guess, repair, normalize, or fall back to another case.
This is the only pre-approval case read. It validates the public case loader and returns only the exact frozen specification, exact public contract, packet hash, repository requirement, compiled oracle identity, and shared framing. If resolution or validation fails, report the error and stop; never guess, repair, normalize, or fall back to another case.

For a case whose inspection reports `requiresSourceRepository: true`, ask for the absolute path to a trusted local checkout containing the pinned commit. This path is controller setup and is never target-visible. Greenfield cases require no source checkout.

Ask which executors to run: **Brunch**, **Claude Code**, or both, and in which disclosed order. The default recommendation is both in the operator's chosen order. This approachable procedure does not claim order blinding, matched private reasoning, or statistical reliability.

Expand All @@ -56,8 +58,9 @@ Display all of the following together before any target preparation or launch:
5. the run identity, case directory id, public case id, and public-packet hash;
6. exact scratch, attempt-record, per-lane target, process-log, final-tree, final-diff, browser-report, and visible-interaction output paths;
7. Brunch's pinned TUI entrypoint and Claude Code's structured adapter;
8. the fixed post-lane oracle identity `petri-editor-browser-v2`; and
9. the limits: sequential lanes, unchanged inputs, no substantive intervention, no landing, no score, no winner, and no reliability or parity claim.
8. the case's compiled post-lane oracle identity returned by `inspect`;
9. whether preparation is greenfield or a pinned remote-free brownfield snapshot; and
10. the limits: sequential lanes, unchanged inputs, no substantive intervention, no landing, no score, no winner, and no reliability or parity claim.

Ask through ordinary typed text for explicit **approve**, **revise**, or **reject**. Ambiguity, questions, qualifications, partial approval, or silence are not approval. Revise and redisplay the complete setup, or reject and stop. Do not prepare a target, start a shell, invoke an executor, or invoke the oracle before explicit approval.

Expand All @@ -82,13 +85,14 @@ Give both executors the exact same frozen specification and public contract with

### Brunch

Prepare through the existing FE-1230 workspace adapter:
Prepare through the case-aware workspace adapter. For greenfield cases omit `--source-repository`; for pinned brownfield cases include the approved absolute source checkout:

```sh
npx tsx src/dev/execution-comparison-operator.ts prepare \
--case <case-id> \
--lane brunch \
--target <fresh-target-cwd>
--target <fresh-target-cwd> \
[--source-repository <absolute-source-checkout>]
```

From the Brunch repository root, open one direct `interactive_shell` using the pinned project-local entrypoint reported by preparation:
Expand All @@ -107,13 +111,14 @@ Keep Brunch run metadata, Petri journal/projection, JSONL, and `.brunch/debug/`

### Claude Code

Prepare through the execution wrapper:
Prepare through the same case-aware wrapper, using the same source checkout rule:

```sh
npx tsx src/dev/execution-comparison-operator.ts prepare \
--case <case-id> \
--lane claude_code \
--target <fresh-target-cwd>
--target <fresh-target-cwd> \
[--source-repository <absolute-source-checkout>]
```

Open one direct `interactive_shell` from the fresh target cwd through Claude Code's normal structured adapter:
Expand All @@ -128,7 +133,7 @@ Send only the approved shared framing. Do not substitute a raw binary, another m

After every lane terminates, first capture its final process status and all target-visible interaction evidence. Kill any still-running executor process, query the shell to a final status, dismiss the completed shell record, and verify that no executor process or interactive session remains.

Then run the unchanged controller-owned `petri-editor-browser-v2` oracle against the retained output:
Then run the unchanged controller-owned oracle identity returned by `inspect` against the retained output:

```sh
npx tsx src/dev/execution-comparison-operator.ts oracle \
Expand All @@ -137,7 +142,7 @@ npx tsx src/dev/execution-comparison-operator.ts oracle \
--out <attempt-staging>/browser/report.json
```

Do this after every lane terminates, including failed, exhausted, and invalid lanes. Let the existing wrapper run the target's declared `npm test` and `npm run build`, start the fixed static server, run the existing independent browser journeys, and close browser/server resources. Do not edit the frozen case, controller files, oracle manifest, fixtures, expected states, browser journey implementation, or report to make a lane pass. If the unchanged oracle cannot start, retain that setup failure and do not invent a product verdict.
Do this after every lane terminates, including failed, exhausted, and invalid lanes. Let the case-owned oracle run its fixed command, build, Git, TUI, or browser checks and close all resources. Do not edit the frozen case, controller files, oracle manifest, fixtures, expected states, journey implementation, or report to make a lane pass. If the unchanged oracle cannot start, retain that setup failure and do not invent a product verdict.

After the oracle exits, verify cleanup again. Retain the target cwd; cleanup means no live process or session, not deletion of evidence. Do not launch the next lane until the prior executor shell and oracle resources are both fully clean.

Expand All @@ -149,7 +154,7 @@ For every successful, failed, exhausted, and invalid attempt, retain immutably:
- elapsed and intervention ledgers;
- cleanup status and any residue;
- the final tree and complete base-to-tip diff, plus honest notes for uncommitted or unavailable material;
- common `npm test`, `npm run build`, and browser results;
- common case-owned command and oracle results;
- normalized visible interaction evidence; and
- the unchanged retained output itself.

Expand All @@ -165,7 +170,7 @@ The immutable writer rejects an existing attempt id. Never overwrite, delete, re

## Report

After all selected lanes terminate and cleanup is proven, write `report.md` beside the unchanged run-start `provenance.json` under the run scratch root. Present validity before outcomes for each lane. Then report factual terminal state, cleanup, produced output, common command results, and unchanged browser-oracle results.
After all selected lanes terminate and cleanup is proven, write `report.md` beside the unchanged run-start `provenance.json` under the run scratch root. Present study design and run identity, then validity before outcomes for each lane, factual terminal state, cleanup, produced output, common command results, unchanged oracle results, requirement findings, limitations, and recommendations. Keep every referenced path repository-relative so `/comparison-publish` can validate the retained bundle.

Keep common evidence and Brunch-only diagnostics visibly separate. Use `not_assessable` for unavailable common evidence. Do not score, rank, choose a winner, claim reliability, infer parity from unavailable or product-private evidence, or let Brunch-only run/Petri/debug data improve its common result. Do not turn ordinary visual hierarchy, clarity, or drag feel into an automatic mechanical verdict.

Expand Down
12 changes: 12 additions & 0 deletions docs/archive/PLAN_HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
This file is the active POC-line plan archive for `memory/PLAN.md`.
Legacy pre-`next` history was moved out of the live docs tree with the old archived implementation.

## 2026-07-22 FE-1241 brownfield comparison closeout

`brownfield-comparison-cases` ([FE-1241](https://linear.app/hash/issue/FE-1241/add-isolated-brownfield-comparison-cases), [PR #362](https://github.com/hashintel/brunch/pull/362)) completed the mechanical expansion from the sole greenfield Petri case to frozen Brunch backend and Petrinaut frontend replays. The branch is `ka/fe-1241-brownfield-comparison-cases`, based on `next` after FE-1240 landed.

The frontier added content-addressed mission/baseline/registry/execution/oracle packets, exact packet handoff, lightweight pinned-source snapshots, closed case-owned dependency recipes, target-bounded Brunch/Claude launch policy, pinned Brunch graph seeding, and compile-time oracle dispatch without widening `ExecutionAttempt`. Brunch replays FE-1201/PR #336 host landing at parent `f5a423b19f76cf345d88053456870a126e451618`; Petrinaut replays PR #9051 optimization UI in the full HASH tree at parent `5c7a2d9db5caa851c38938f4b1bac19005b0e978`. Historical patches bootstrap claims and rivals but are never golden diffs or target-visible material.

D137-L is the shared pinned preparation path. D136-L permits only the compiled immutable Petrinaut install before execution and the closed focused builds after lane termination. Brunch's public `/brunch:land` journey is judged by an independent full-range Git model; Petrinaut's standalone `/optimization` journey is judged through a same-origin deterministic optimizer, declared mechanical addresses, calibration-derived inputs, and contrastive rivals. Petri remains the greenfield case; Clay, arbitrary commands/plugins, source landing, aggregate winners, repetitions, and `ExecutionAttempt` schema changes remain out.

Before merge, the implementation was reoriented from publication-grade benchmark proof to fast product learning. The automated merged-reference preflight, duplicate HASH installations, macOS network verifier, external-service probes, and receipt machinery were retired. Routine runs now use remote-free pinned snapshots and bounded tools as explicit experimental hygiene; source/reference calibration is repeated only when the source, public contract, or oracle changes. Current implementation state lives in [`src/dev/TOPOLOGY.md`](../../src/dev/TOPOLOGY.md); operational guidance lives in [`docs/praxis/comparison-runs.md`](../praxis/comparison-runs.md).

The retained hardening binds the calibration seed into oracle identity, uses typed source-backed Petrinaut addresses without fixture fallback, aligns the Brunch public type with its backend runtime shape, and requires absolute oracle evidence output. The shared `/compare-execution` workflow now derives repository preparation and oracle identity from every selected case and retains publication-compatible provenance, attempts, cleanup, and validity-first reports for Petri, Brunch host landing, and Petrinaut.

## 2026-07-22 Executor Petri sequence reconciliation

`executor-slice-attempt-lifecycle` (FE-1192) merged in #324 on 2026-07-13. `petri-execution-parity` (FE-1195) then absorbed and completed the planned isolation/fan-in, durable parallel authority, Petrinaut-visible attempt topology, and epic integration sequence in #325. Their stale active/future entries and dependency chain were retired from `memory/PLAN.md`; current execution ownership and lifecycle semantics live in `src/executor/TOPOLOGY.md` under D127-L–D129-L.
Expand Down
4 changes: 3 additions & 1 deletion docs/praxis/comparison-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ From a trusted top-level project Pi session, run:

```text
/compare-execution minimal-petri-net-editor
/compare-execution brunch-host-landing
/compare-execution petrinaut-optimization
```

The workflow gives Brunch and Claude Code the same frozen specification and applies the same independent browser checks to both outputs. Alpha 10 records the Brunch version and commit automatically.
The workflow gives Brunch and Claude Code the same frozen specification and applies the selected case's independent checks to both outputs. Brownfield cases require a local checkout containing their pinned parent commit; the operator creates a fresh remote-free target from it. Alpha 10 records the Brunch version and commit automatically.

## End-to-end comparison

Expand Down
18 changes: 17 additions & 1 deletion docs/praxis/comparison-runs.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ The publication skill validates `report.md`, `provenance.json`, and the availabl

## Quick start: compare execution

From a trusted top-level project Pi session, run:
From a trusted top-level project Pi session, run any frozen execution case:

```text
/compare-execution minimal-petri-net-editor
/compare-execution brunch-host-landing
/compare-execution petrinaut-optimization
```

The project-local operator displays the frozen specification, public contract, selected Brunch/Claude
Expand All @@ -84,10 +86,24 @@ fresh isolated lane at a time, cleans up each live shell before continuing, and
controller-owned browser oracle to every retained outcome. With no case id,
`/compare-execution` lists eligible cases under `testing/execution-comparisons/cases/`.

Greenfield cases prepare an empty repository. Brownfield cases ask for a trusted local source checkout,
materialize the pinned commit into a fresh remote-free repository, add the exact packet, and disable
web/MCP surfaces while bounding file access to the target. This prevents accidental contamination; it
does not claim adversarial isolation from every host capability.

This is developer/evaluation tooling under `.pi/prompts/`, not a shipped Brunch product command.
Brunch stops at `promotion_prepared`; the operator never invokes `/brunch:land`, scores a lane, chooses
a winner, or treats Brunch-only run/Petri/debug evidence as common comparison evidence.

### Petrinaut calibration

The Petrinaut oracle uses the standalone `/optimization` route, closed focused builds, and a
deterministic loopback optimizer. Its source-backed addresses were calibrated against PR #9051 during
case construction. Recheck the pinned parent fails and the merged reference passes only when the
source commit, public contract, or oracle changes; record that bounded calibration in the change that
updates the case. Routine comparisons do not duplicate the HASH install or materialize a reference
checkout before every provider run.

## End-to-end comparison tracer

The end-to-end tracer composes the rigorous elicitation recipe with the execution-comparison contracts
Expand Down
Loading
Loading