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
2 changes: 1 addition & 1 deletion .agents/skills/evidence-status-discipline/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These are the specific overclaims this architecture invites. Use the right-hand
| exactly-once execution | at-least-once delivery with idempotent effect handling; at most one accepted outcome per intended attempt | The worker protocol is at-least-once (ADR-002). Uniqueness constraints deduplicate *effects*; they do not make *execution* exactly-once. |
| deterministic execution | deterministic state reconstruction from the ordered event stream | Invariant 6 promises replay reproduces logical state. Infrastructure timing may differ between executions. |
| guaranteed no data loss | no accepted observation lost across the tested process-termination boundaries | A guarantee is universal; a test covers the boundaries it injected. Name them. |
| production-ready | deployed and operated under the documented runbook, with the recovery evidence in `<artifact>` | `docs/ROADMAP.md` Slice 6: a cloud URL is not production proof. |
| production-ready | deployed and operated under the documented runbook, with the recovery evidence in `<artifact>` | `docs/ROADMAP.md` open operational gaps: a cloud URL is not production proof. |
| demonstrates / proves | implements, when there is no artifact | Reserve for `demonstrated`. |
| fault-tolerant | fault-aware: every failure produces a durable outcome and a classified failure code | Tolerance implies continued correct service; awareness is what the design provides. |
| calibrated uncertainty | model uncertainty from `<policy>`, uncalibrated | `AI_CONTRACT.md` §11 forbids calibrated-uncertainty claims without a defined calibration procedure and evaluation. |
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/her-source-discipline/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ paths: scripts/fetch_her.py, scripts/inspect_her.py, src/labbridge/infrastructur

# HER source discipline

Authority: `AI_CONTRACT.md` invariant 11 and §7; `docs/DATA_STRATEGY.md` §2; `docs/ROADMAP.md` Gate 0.
Authority: `AI_CONTRACT.md` invariant 11 and §7; `docs/DATA_STRATEGY.md` §2, including the §2.3 source, licence, and schema gate.

Pinned sources: Zenodo DOI `10.5281/zenodo.20439519` (dataset, authoritative for archive contents) and
arXiv `2606.00779` (preprint, authoritative for method and interpretation).
Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/migration-and-schema-evolution/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ paths: alembic/**, migrations/**, src/labbridge/infrastructure/postgres/**, src/
# Migration and schema evolution

Authority: `AI_CONTRACT.md` §6 and §9; `docs/SPEC.md` §4.1, §5; `docs/FAILURE_MATRIX.md` F-019, F-039,
F-042; `docs/ROADMAP.md` Slice 3 and Slice 6.
F-042; `AI_CONTRACT.md` §10 and `docs/ROADMAP.md`.

Two distinct kinds of evolution live here. Do not conflate them.

Expand Down Expand Up @@ -58,7 +58,7 @@ migration upgrade tests and downgrade tests where safe and supported.

### Deployment

`docs/ROADMAP.md` Slice 6 requires a migration exercised against production-like data and a documented
`AI_CONTRACT.md` §10 requires a migration exercised against production-like data and a documented
application rollback procedure, plus the interrupted-migration recovery path. Until that has been run
and recorded, migration safety is `implemented`, never `demonstrated`.

Expand Down
4 changes: 2 additions & 2 deletions .claude/agents/reliability-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ skills:
You are the reliability and failure-injection reviewer for `labbridge`.

Your authorities are `docs/FAILURE_MATRIX.md`, `docs/SPEC.md` §15 (proof obligations PO-01 to PO-10),
`AI_CONTRACT.md` §3 (invariants 2, 5, 6, 9) and §6, and `docs/ROADMAP.md` (which slice must satisfy
which scenarios).
`AI_CONTRACT.md` §3 (invariants 2, 5, 6, 9) and §6, and `docs/PROJECT_STATUS.md` (what each
capability's evidence already covers).

You are read-only. Never edit, never change Git state, never invoke another agent. Use `Bash` for
inspection and for running existing tests without `--fix`, `-p no:cacheprovider` where available.
Expand Down
6 changes: 3 additions & 3 deletions .claude/agents/scope-guard.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Read the current file contents, not remembered status:
1. `AI_CONTRACT.md` — invariants (§3), approved stack (§4), boundaries (§5), forbidden patterns (§11);
2. `docs/SPEC.md` — V1 boundaries (§2), proof obligations (§15), module map (§16);
3. `docs/ARCHITECTURE_DECISIONS.md` — accepted decisions and their consequences;
4. `docs/ROADMAP.md` — gate and slice ordering, exit criteria, stop conditions, release blockers;
4. `docs/PROJECT_STATUS.md` and `docs/ROADMAP.md` — current capability status, open gaps, deferred tracks;
5. `docs/DATA_STRATEGY.md` and `docs/SIMULATOR_MODEL.md` — scientific and licence boundaries;
6. `docs/FAILURE_MATRIX.md` — which failure semantics a slice must already satisfy.

Expand All @@ -56,8 +56,8 @@ a comment claiming a gate passed, or a branch name.
Roadmap position is evidence-based, not asserted. Establish it from the repository:

- which of Gate 0 and Slices 1–7 have their **deliverables** present on disk;
- whether the exit criteria of the preceding slice are met by inspectable evidence, not by intent;
- whether `docs/ROADMAP.md` stop conditions for the preceding slice are cleared.
- whether the status a task assumes is met by inspectable evidence, not by intent;
- whether the task would silently start a track `docs/ROADMAP.md` records as deferred.

If you cannot establish the active slice from the repository, say so and treat timing as unresolved
rather than assuming the slice the request implies.
Expand Down
4 changes: 2 additions & 2 deletions .claude/agents/verification-auditor.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Re-run it. Read the output. Count the failures.
Restate the claim precisely, and classify it:

- **a change is complete** — the per-change definition of done, `AI_CONTRACT.md` §10;
- **a slice is complete** — every exit criterion of that slice in `docs/ROADMAP.md`, with no stop
condition tripped;
- **a capability's status is justified** — the evidence `docs/PROJECT_STATUS.md` names for it exists
and verifies;
- **a capability is `implemented`** — code exists and its relevant local automated tests pass;
- **a capability is `demonstrated`** — a reproducible artifact, manifest, or operational experiment
proves it;
Expand Down
4 changes: 2 additions & 2 deletions .claude/commands/audit-repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exists.
## 2. Documentation consistency

- Do `AI_CONTRACT.md`, `docs/SPEC.md`, `docs/ARCHITECTURE_DECISIONS.md`, `docs/DATA_STRATEGY.md`,
`docs/SIMULATOR_MODEL.md`, `docs/FAILURE_MATRIX.md`, and `docs/ROADMAP.md` agree? Resolve conflicts by
`docs/SIMULATOR_MODEL.md`, `docs/FAILURE_MATRIX.md`, and `docs/PROJECT_STATUS.md` agree? Resolve conflicts by
the precedence in `AI_CONTRACT.md`, section *"When documents conflict"*, and **report** the conflict —
never pick the convenient reading silently.
- Do `CLAUDE.md`, `AGENTS.md`, `.claude/`, and `.agents/` contradict `AI_CONTRACT.md` anywhere?
Expand All @@ -48,7 +48,7 @@ Establish the active slice from what exists on disk, not from what the documents
Gate 0 and Slices 1–7: deliverables present, exit criteria met, stop conditions cleared. Report the
first slice whose exit criteria are not met — that is where work belongs.

Check the V1 release blockers in `docs/ROADMAP.md` and report which are currently open.
Check the open gaps and deferred tracks in `docs/ROADMAP.md` and report which are still open.

## 5. Failure and proof coverage

Expand Down
4 changes: 2 additions & 2 deletions .claude/commands/plan-slice.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Plan the following task against the LabBridge roadmap. Do not write implementati

## 1. Establish the active roadmap slice from evidence

Read `docs/ROADMAP.md`. Determine the active slice from what exists on disk — deliverables present, exit
criteria met by inspectable evidence, stop conditions cleared — not from what the task assumes. If you
Read `docs/PROJECT_STATUS.md` and `docs/ROADMAP.md`. Determine the current position from what exists on
disk — deliverables present, evidence inspectable — not from what the task assumes. If you
cannot establish it, say so and treat timing as unresolved.

## 2. Scope
Expand Down
2 changes: 1 addition & 1 deletion .claude/commands/review-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ Use the review block at the end of the `migration-and-schema-evolution` skill. C
`SAFE`, `SAFE WITH SEQUENCING`, or `UNSAFE` — and an explicit *Untested claims* line.

The migration file existing is not evidence the migration is safe. Until it has been exercised against
production-like data with a documented rollback (`docs/ROADMAP.md` Slice 6), migration safety is
production-like data with a documented rollback (`AI_CONTRACT.md` §10), migration safety is
`implemented`, never `demonstrated`.
2 changes: 1 addition & 1 deletion .claude/skills/evidence-status-discipline/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These are the specific overclaims this architecture invites. Use the right-hand
| exactly-once execution | at-least-once delivery with idempotent effect handling; at most one accepted outcome per intended attempt | The worker protocol is at-least-once (ADR-002). Uniqueness constraints deduplicate *effects*; they do not make *execution* exactly-once. |
| deterministic execution | deterministic state reconstruction from the ordered event stream | Invariant 6 promises replay reproduces logical state. Infrastructure timing may differ between executions. |
| guaranteed no data loss | no accepted observation lost across the tested process-termination boundaries | A guarantee is universal; a test covers the boundaries it injected. Name them. |
| production-ready | deployed and operated under the documented runbook, with the recovery evidence in `<artifact>` | `docs/ROADMAP.md` Slice 6: a cloud URL is not production proof. |
| production-ready | deployed and operated under the documented runbook, with the recovery evidence in `<artifact>` | `docs/ROADMAP.md` open operational gaps: a cloud URL is not production proof. |
| demonstrates / proves | implements, when there is no artifact | Reserve for `demonstrated`. |
| fault-tolerant | fault-aware: every failure produces a durable outcome and a classified failure code | Tolerance implies continued correct service; awareness is what the design provides. |
| calibrated uncertainty | model uncertainty from `<policy>`, uncalibrated | `AI_CONTRACT.md` §11 forbids calibrated-uncertainty claims without a defined calibration procedure and evaluation. |
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/her-source-discipline/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ paths: scripts/fetch_her.py, scripts/inspect_her.py, src/labbridge/infrastructur

# HER source discipline

Authority: `AI_CONTRACT.md` invariant 11 and §7; `docs/DATA_STRATEGY.md` §2; `docs/ROADMAP.md` Gate 0.
Authority: `AI_CONTRACT.md` invariant 11 and §7; `docs/DATA_STRATEGY.md` §2, including the §2.3 source, licence, and schema gate.

Pinned sources: Zenodo DOI `10.5281/zenodo.20439519` (dataset, authoritative for archive contents) and
arXiv `2606.00779` (preprint, authoritative for method and interpretation).
Expand Down
4 changes: 2 additions & 2 deletions .claude/skills/migration-and-schema-evolution/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ paths: alembic/**, migrations/**, src/labbridge/infrastructure/postgres/**, src/
# Migration and schema evolution

Authority: `AI_CONTRACT.md` §6 and §9; `docs/SPEC.md` §4.1, §5; `docs/FAILURE_MATRIX.md` F-019, F-039,
F-042; `docs/ROADMAP.md` Slice 3 and Slice 6.
F-042; `AI_CONTRACT.md` §10 and `docs/ROADMAP.md`.

Two distinct kinds of evolution live here. Do not conflate them.

Expand Down Expand Up @@ -58,7 +58,7 @@ migration upgrade tests and downgrade tests where safe and supported.

### Deployment

`docs/ROADMAP.md` Slice 6 requires a migration exercised against production-like data and a documented
`AI_CONTRACT.md` §10 requires a migration exercised against production-like data and a documented
application rollback procedure, plus the interrupted-migration recovery path. Until that has been run
and recorded, migration safety is `implemented`, never `demonstrated`.

Expand Down
24 changes: 11 additions & 13 deletions .claude/tools/gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,43 +216,41 @@ def collect(root: Path) -> list[Gate]:
"pytest-integration",
"pytest -q -m integration",
LIVE if has_integration and _has("pytest") else SCAFFOLDED,
"requires PostgreSQL and MinIO running; ROADMAP Slice 1 brings up the stack"
"requires `docker compose --profile infrastructure up -d`"
if has_integration
else "no test carries @pytest.mark.integration yet (ROADMAP Slice 1)",
else "no test carries @pytest.mark.integration yet",
),
Gate(
"pytest-data",
"pytest -q -m data",
LIVE if has_data and _has("pytest") else SCAFFOLDED,
"requires the fetched HER archive on disk (ROADMAP Gate 0)"
"requires the fetched HER archive on disk (`labbridge fetch-her`)"
if has_data
else "no test carries @pytest.mark.data yet (ROADMAP Gate 0)",
else "no test carries @pytest.mark.data yet",
),
Gate(
"migrations",
"pytest -q -m integration -k migration",
LIVE if migrations and has_migration_test else SCAFFOLDED,
"migration directory and matching integration test present"
if migrations and has_migration_test
else "no alembic/ or migrations/ directory yet (ROADMAP Slice 1)"
else "no alembic/ or migrations/ directory yet"
if not migrations
else "no integration test matches -k migration (ROADMAP Slice 1)",
else "no integration test matches -k migration",
),
Gate(
"artifacts",
"PYTHONPATH=src python -m labbridge.cli validate-artifacts",
LIVE if artifacts_cmd else SCAFFOLDED,
"command responds to --help; verifies the committed artifacts/ tree"
if artifacts_cmd
else "`validate-artifacts` is not implemented yet (ROADMAP Slice 3)",
else "`validate-artifacts` is not implemented yet",
),
Gate(
"compose",
"docker compose up --build",
"docker compose --profile demo up --build",
LIVE if compose and _has("docker") else SCAFFOLDED,
"compose file present"
if compose and _has("docker")
else "no compose file yet (ROADMAP Slice 1)",
"compose file present" if compose and _has("docker") else "no compose file yet",
),
# --- release-level gates ------------------------------------------------------------------
Gate(
Expand All @@ -263,15 +261,15 @@ def collect(root: Path) -> list[Gate]:
LIVE if has_replay and _has("pytest") else SCAFFOLDED,
"proves PO-01"
if has_replay
else "no integration test named test_replay_determinism* yet (ROADMAP Slice 2)",
else "no integration test named test_replay_determinism* yet",
),
Gate(
"fault-campaign",
"pytest -q -m slow -k fault_campaign",
LIVE if has_fault_campaign and _has("pytest") else SCAFFOLDED,
"process-boundary checkpoint proof; release command runs at least 100 seeded campaigns"
if has_fault_campaign
else "no slow test named fault_campaign yet (ROADMAP Phase 7)",
else "no slow test named fault_campaign yet",
),
Gate(
"backup-restore",
Expand Down
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ invariants, architectural boundaries, proof requirements, and document precedenc
relevant sections of:

- [`docs/SPEC.md`](docs/SPEC.md) for required behaviour;
- [`docs/ROADMAP.md`](docs/ROADMAP.md) for the active delivery slice;
- [`docs/PROJECT_STATUS.md`](docs/PROJECT_STATUS.md) for the current status of every capability;
- [`docs/ROADMAP.md`](docs/ROADMAP.md) for open gaps and deferred tracks;
- [`docs/DATA_STRATEGY.md`](docs/DATA_STRATEGY.md) for source, metadata, and lineage rules;
- [`docs/FAILURE_MATRIX.md`](docs/FAILURE_MATRIX.md) for required failure semantics;
- [`docs/ARCHITECTURE_DECISIONS.md`](docs/ARCHITECTURE_DECISIONS.md) for accepted decisions;
Expand All @@ -21,7 +22,7 @@ Report contradictions instead of choosing the most convenient interpretation.
## Working rules

- Inspect the existing implementation, migrations, tests, fixtures, and source data before editing.
- Keep each change to the smallest coherent unit that satisfies a current roadmap exit criterion.
- Keep each change to the smallest coherent unit that satisfies a falsifiable acceptance criterion.
- Add or update tests at the layer required by the claim; do not weaken an invariant to make a test
pass.
- Never infer source columns, units, electrochemical conventions, or dataset semantics from memory.
Expand Down
19 changes: 10 additions & 9 deletions AI_CONTRACT.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ The companion documents define:

- `docs/SPEC.md`: what the system must do;
- `docs/DATA_STRATEGY.md`: data sources and scientific boundaries;
- `docs/ROADMAP.md`: dependency order and exit criteria;
- `docs/PROJECT_STATUS.md`: the current status of every capability and the evidence behind it;
- `docs/ROADMAP.md`: what remains open and what is deferred;
- `docs/SIMULATOR_MODEL.md`: the biosensor simulator's scientific contract;
- `docs/FAILURE_MATRIX.md`: failure scenarios the runtime must handle;
- `docs/ARCHITECTURE_DECISIONS.md`: accepted architectural decisions.
Expand All @@ -38,7 +39,7 @@ An implementation agent MUST report a contradiction rather than silently choosin
- Write code, comments, identifiers, schemas, commit messages, and technical documentation in English.
- Be short and direct. Do not add promotional narration.
- Ask a question only when an ambiguity materially changes scientific validity, architecture, data integrity, or public claims.
- When a safe, simpler interpretation exists within the current roadmap slice, use it and state the assumption instead of blocking progress.
- When a safe, simpler interpretation exists within the current task's scope, use it and state the assumption instead of blocking progress.
- Present alternatives when they carry meaningfully different trade-offs.

### Behavioural guidelines
Expand Down Expand Up @@ -99,10 +100,10 @@ diary.

Turn failure-prone electrochemical measurement records into validated, provenance-tracked scientific datasets, and execute experimental campaigns through a durable, auditable, resumable runtime that treats failures and recovery as explicit domain outcomes.

LabBridge is demonstrated through two separate environments behind a shared runtime interface:
LabBridge defines two separate environments behind a shared runtime interface:

- an observed Au–Ir–Rh HER dataset executed in replay mode;
- a synthetic, electrochemistry-informed biosensor environment executed in simulation mode.
- an observed Au–Ir–Rh HER dataset executed in replay mode, which is implemented;
- a synthetic, electrochemistry-informed biosensor environment executed in simulation mode, which is `deferred` and has no adapter.

The two environments test the same infrastructure abstractions. They are not fidelities of one shared scientific candidate space.

Expand Down Expand Up @@ -319,7 +320,7 @@ The V1 stack is intentionally small:
- pytest and pytest-asyncio;
- mypy or pyright in strict mode;
- ruff for formatting and linting;
- one managed cloud deployment during portfolio hardening.
- one managed cloud deployment.

No heavyweight ML framework or GPU path belongs in V1.

Expand Down Expand Up @@ -512,7 +513,7 @@ The V1 release MUST satisfy the proof obligations in `docs/SPEC.md` and the mand

A change is complete only when:

1. it is in scope for the current roadmap slice;
1. it is in scope for the requested task and does not silently start a deferred track;
2. its typed interface exists;
3. relevant failure modes are explicit;
4. relevant unit and integration tests pass;
Expand Down Expand Up @@ -589,10 +590,10 @@ Implementation agents MUST NOT:

## 12. Agent execution protocol

Before coding a roadmap slice, an implementation agent MUST:
Before coding a task, an implementation agent MUST:

1. read this contract and the relevant specification sections;
2. confirm that the task belongs to the current roadmap slice;
2. confirm that the task is in scope and is not a deferred track in `docs/ROADMAP.md`;
3. identify the invariants touched;
4. state the intended transaction, process, and failure boundaries;
5. list the tests and artifacts that will prove the exit criterion;
Expand Down
Loading
Loading