Skip to content
Open
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
24 changes: 24 additions & 0 deletions packages/extension/packs/ee-test-measurement/FIRST-TASK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# First task — the shakedown exercise (declared; NOT yet run)

**The task:** one non-QICK instrument class through the strumento device
schema against **mock instruments** — a signal-generator + spectrum-analyzer
fit cycle via the task-record seam: author a device instance for the bench
class (schema extension in scope this pass), run a fit cycle
(`instrumento fit lorentzian`-class) against a mock measurement, record the
task (manifest, progress stream, terminal result), and fold a **T1b,
tier-labeled verdict** (residuals against declared tolerance) end-to-end
through the loop.

**Exercise level: shakedown** — the loop plumbing end-to-end on synthetic
substrate. It certifies the pack's mechanics (schema → task record →
verdict → fold), not the domain's real capability. Substrate-touching
exercise (a real bench run) is the tracked next milestone, gated on
hardware access that is not wired in this build — stated, not assumed.

**The polyglot seam rides the same exercise:** the task record the mock run
produces is written by the Python task-record writer and read by a Julia
consumer — one round-trip exercising the contract's shape across languages.

**Exit:** the run exists with a run ID, a tier-labeled verdict, and the task
directory intact — then this pack is EXERCISED (shakedown), and this
declaration updates to point at the run.
53 changes: 53 additions & 0 deletions packages/extension/packs/ee-test-measurement/PACK.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# The EE / test-&-measurement domain pack (plan-20260920 step 10; amicode #1328).
# The strumento substrate — device model, task records, calibration store —
# is this domain in quantum clothing; this pack generalizes it to instruments.
# SEEDED, not exercised: the manifest + references resolve; the first task
# (a mock-instrument fit cycle) is the shakedown exercise, the next milestone.
#
# SCOPE BOUND (honest): instruments the device schema actually models. The
# schema today models QICK-class hardware; the first task extends it to the
# bench signal-generator + spectrum-analyzer class (mock). Everything the
# schema does NOT model is out of scope until modeled — stated, never assumed.
schema_version = "1"
id = "ee-test-measurement"
name = "Electrical Engineering / Test & Measurement"
version = 1
scores = []
curricula = ["curricula/instrument-bringup/CURRICULUM.md"]
skills = [] # the strumento skill generalizes at exercise time; none shipped yet
payload_schemas = ["PAYLOADS.md"]
benchmarks = ["benchmarks/README.md"]

[[instruments]]
kind = "strumento device schema (QICK-class, existing)"
coverage = "modeled"

[[instruments]]
kind = "bench signal generator (mock, schema extension this pass)"
coverage = "modeled-at-first-task"

[[instruments]]
kind = "spectrum analyzer (mock, schema extension this pass)"
coverage = "modeled-at-first-task"

[verification]
contract = "VERIFICATION.md"
bindings = [
"measurement residuals: T1b (deterministic given the recorded artifact; residuals against declared tolerance, honestly noise-bounded)",
"closed-loop recalibration: T1b over the recorded calibration-store chain",
"hardware claims: un-tiered until measured on real instruments (mock runs certify nothing about hardware)",
]

[first_task]
declaration = "FIRST-TASK.md"
level = "shakedown"

[onboarding]
primary = "instrument-bringup"
head = "instrument-bringup"

[corrector]
name = "task-record contract (the strumento seam: the directory is the truth; verdicts re-derived from the record)"
paths = ["FIRST-TASK.md", "VERIFICATION.md"]
integrity = "corrector/integrity.toml"
tier = "open"
10 changes: 10 additions & 0 deletions packages/extension/packs/ee-test-measurement/PAYLOADS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# EE / test-&-measurement — typed payloads

The pack's payload vocabulary (additive; the schema package is the arbiter):

- `measurement-result` — {quantity, value, tolerance, artifact-ref, provenance} — T1b-verified residuals against the recorded artifact
- `calibration-ref-advance` — {ref, parent, config-content-id, per-key-diffs} — the calibration store's content-addressed chain
- `task-record-terminal` — {state, error_kind (script | transport — who fixes them), gates-forwarded, authored_by} — the strumento seam

Every payload carries `tier` (T1a | T1b | T2 | T3 | un-tiered | pre-tier) —
the enum travels with the claim through every render path.
21 changes: 21 additions & 0 deletions packages/extension/packs/ee-test-measurement/VERIFICATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EE / test-&-measurement — the verification contract

Tiered and claim-class-bound (spec-20260920-171500 D4): a tier tag asserts
what the instrument establishes, never more.

| Claim class | Tier | The gate |
|---|---|---|
| Measurement residuals (recorded artifact vs model, declared tolerance) | **T1b** | deterministic given the recorded artifact — the measurement is stochastic, the residual check over the recorded artifact is not; tolerance declared per contract, residuals honestly noise-bounded |
| Closed-loop recalibration (the measure → believe → measure-again chain) | **T1b** | the calibration store's content-addressed chain: each ref advance re-derived from the record, never self-graded |
| Hardware claims (real instruments) | **un-tiered** | mock runs certify NOTHING about hardware — the tier appears only when real instruments are measured; the scope bound holds |
| Bringup state (device model vs manifest) | **T1b** | the strumento device-schema validation (typed errors, `ok: false` carries the error class) |

**The re-tiering rule:** upgrade on new mechanical evidence (provenance
stamped); downgrade/quarantine when an instrument is invalidated, cascading
to the claims it certified. Historical records render `pre-tier` with
provenance until retro-labeled via the deterministic class→tier table.

**The task-record contract is the trust boundary:** the directory is the
truth; verdicts forwarded from gates are re-derived from the record before
routing; only declared gates forward at all; forwarding requires a
non-empty `authored_by`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# EE / test-&-measurement — benchmarks

Declared, not yet populated (honest v1): the benchmark surface lands with
the first-task exercise — the fit-cycle run's measured table (residuals,
wall-clock, retries per fit kind) is the first bench row, cited with its
run ID. Performance and quality claims cite bench rows, never adjectives.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# sha256 integrity manifest for the corrector paths (relative to the pack dir).
# Verified at load time (WS1 #369 pattern): a mismatch makes the pack BROKEN.
# Regenerate: shasum -a 256 <path> from the pack dir.
[files]
"FIRST-TASK.md" = "971f100a28f673ccabd73a0662abd58f4dd14c6bcf2d5e4b123febc526891547"
"VERIFICATION.md" = "3d53456c5a60b266cf79e3d0b09e6f634b6bb3439871f415c0730f706d895eb2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
type: curriculum
schema_version: "1"
id: instrument-bringup
version: 1
description: >-
The skeleton seed for the EE domain's guided path: device-model definition,
mock bringup, the fit cycle, the task-record discipline. Stages are
placeholders until the first-task exercise informs them — a curriculum is
authored from measured practice, not speculation.
stages: [] # deliberately empty: the skeleton exists so the manifest resolves; content lands with exercise
memory_hooks: [] # none yet — hook-card genesis proposes them from recurring questions
---

# Instrument bringup (skeleton)

The guided path from a device description to a verified fit cycle. Authored
from the first-task exercise when it runs — the curriculum grows from what
the loop actually needed, not from a speculative plan.
17 changes: 17 additions & 0 deletions packages/extension/packs/sensing-metrology/FIRST-TASK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# First task — the shakedown exercise (declared; NOT yet run)

**The task:** filter-function validation against synthetic noise spectra —
compute the filter response for a representative filter-function family
against declared synthetic spectra, fold the verdict with confidence
intervals (the estimation payload) end-to-end through the loop, tier-labeled
T1b. The synthetic ground truth is declared up front: the harness compares
deterministically over it.

**Exercise level: shakedown** — loop plumbing on synthetic substrate; it
certifies the pack's mechanics, not the domain's real capability.
Substrate-touching exercise (real NV data) is the tracked next milestone —
the NV testbed is not wired in this build, stated plainly.

**Exit:** the run exists with a run ID, a tier-labeled verdict with CIs,
and the artifacts intact — then this pack is EXERCISED (shakedown), and this
declaration updates to point at the run.
45 changes: 45 additions & 0 deletions packages/extension/packs/sensing-metrology/PACK.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# The sensing / metrology domain pack (plan-20260920 step 10; amicode #1328).
# The NV-center substrate is the existing exploratory bet (INTENT's
# exploratory tier); this pack seeds the domain: filter functions, noise
# spectroscopy, metrology-grade estimation with confidence intervals.
# SEEDED, not exercised: the first task (filter-function validation against
# synthetic noise spectra) is the shakedown exercise, the next milestone.
schema_version = "1"
id = "sensing-metrology"
name = "Sensing & Metrology"
version = 1
scores = []
curricula = ["curricula/noise-spectroscopy/CURRICULUM.md"]
skills = [] # the sensing physics rides the flagship's Lindblad/filter-function material at exercise time
payload_schemas = ["PAYLOADS.md"]
benchmarks = ["benchmarks/README.md"]

[[instruments]]
kind = "NV-center testbed (data substrate, not wired in this build)"
coverage = "unmodeled-until-hardware"

[[instruments]]
kind = "synthetic noise spectra (validation substrate)"
coverage = "modeled"

[verification]
contract = "VERIFICATION.md"
bindings = [
"filter-function validation vs synthetic spectra: T1b (exit-code + artifact contract — the validation harness over the synthetic ground truth)",
"estimation results (noise spectral density, filter response): T1b with CI folding — the estimation payload carries lo/hi bounds and the method tag",
"real-testbed claims: un-tiered until real data is measured",
]

[first_task]
declaration = "FIRST-TASK.md"
level = "shakedown"

[onboarding]
primary = "noise-spectroscopy"
head = "noise-spectroscopy"

[corrector]
name = "synthetic-spectra ground truth (the validation harness: declared spectra, deterministic comparison)"
paths = ["FIRST-TASK.md", "VERIFICATION.md"]
integrity = "corrector/integrity.toml"
tier = "open"
8 changes: 8 additions & 0 deletions packages/extension/packs/sensing-metrology/PAYLOADS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Sensing / metrology — typed payloads

- `estimation-result` — {quantity, value, lo, hi, method, artifact-ref, provenance} — the CI-folding payload (the EstimationResult class)
- `validation-verdict` — {claim, tier (T1b), ground-truth-ref, delta, tolerance} — the synthetic-spectra comparison
- `filter-function-artifact` — {family, parameters, response-array-ref, sha} — the computed response, content-addressed

Every payload carries `tier` — the enum travels with the claim (un-tiered
for real-testbed claims until measured; pre-tier for historical records).
13 changes: 13 additions & 0 deletions packages/extension/packs/sensing-metrology/VERIFICATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Sensing / metrology — the verification contract

Tiered and claim-class-bound (spec-20260920-171500 D4):

| Claim class | Tier | The gate |
|---|---|---|
| Filter-function validation vs synthetic spectra | **T1b** | exit-code + artifact contract: the validation harness compares computed filter response against the declared synthetic ground truth — deterministic over the declared spectra |
| Estimation results (noise spectral density, filter response, with CI) | **T1b** | the estimation payload carries value + lo/hi bounds + the method tag; the CI folds into the ledger as an EstimationResult-class payload |
| Real-testbed claims (NV hardware) | **un-tiered** | synthetic validation certifies NOTHING about the real testbed; the tier appears only when real data is measured |
| Metrology-grade comparisons (cross-method) | **T1b** | reproducible comparison over recorded artifacts; the better method wins on declared metrics, never vibes |

**The re-tiering rule** and the `pre-tier`/retro-labeling discipline: as in
the EE contract (spec-20260920 D4, one rule for every domain).
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Sensing / metrology — benchmarks

Declared, not yet populated (honest v1): the first bench row is the
first-task validation's measured table (filter families × spectra shapes ×
deltas vs tolerances), cited with its run ID.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# sha256 integrity manifest for the corrector paths (relative to the pack dir).
# Verified at load time (WS1 #369 pattern): a mismatch makes the pack BROKEN.
# Regenerate: shasum -a 256 <path> from the pack dir.
[files]
"FIRST-TASK.md" = "e75ac866f0a60eaf4852422d0083ab5806b8f66cf1549472b33748f845c94cfa"
"VERIFICATION.md" = "fcfc12df1318989ee034a38d0483a9ca3e36fa3563a989982f550d673f0eba06"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
type: curriculum
schema_version: "1"
id: noise-spectroscopy
version: 1
description: >-
The skeleton seed for the sensing domain's guided path: filter-function
selection, noise-spectroscopy estimation, metrology-grade comparison.
Stages are placeholders until the first-task exercise informs them —
authored from measured practice, not speculation.
stages: []
memory_hooks: []
---

# Noise spectroscopy (skeleton)

The guided path from a sensing question to a CI-bounded estimation. Authored
from the first-task exercise when it runs.
133 changes: 133 additions & 0 deletions packages/extension/src/scores/pack_lint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// The pack lint (plan-20260920 step 10; amicode #1328) — "seeded" means
// something. The loader (packs.ts) loads and reports; the LINT is the bar the
// acceptance reads: schema validation PLUS reference resolution PLUS the
// domain key set. A pack counts as SEEDED when its manifest validates, every
// path-bearing reference resolves, and it carries the full domain keys
// (curricula, payload schemas, verification contract with claim-class
// bindings, instruments, benchmarks, first task). The flagship quantum pack
// carries no first task by design — it reads FORMALIZED, not seeded (the
// grandfathered status, spec-20260920 D2/D7).
//
// A manifest is cheap; a domain is not (the r3 advisory, verbatim): the
// exercised bar — the first task run end-to-end through the campaign loop
// with a tier-labeled verdict — is a run state, never a manifest state; the
// lint records the declared level (shakedown | substrate) and stops there,
// honestly.
import * as fs from "node:fs";
import * as path from "node:path";
import { validateFile } from "@amicode/schema";
import { parse as parseToml } from "smol-toml";

export interface PackLintFinding {
kind: "schema" | "dangling-ref" | "missing-domain-key";
detail: string;
}

export interface PackLintResult {
dir: string;
id: string;
seeded: boolean;
exerciseLevel: "shakedown" | "substrate" | undefined;
findings: PackLintFinding[];
}

/** The domain key set — required for SEEDED, optional at the schema layer so
* the flagship's WS1 manifest stays valid without them. */
export const DOMAIN_KEYS = [
"curricula",
"payload_schemas",
"verification",
"instruments",
"benchmarks",
"first_task",
] as const;

interface PathBearing {
field: string
p: string
}

function collectReferences(manifest: Record<string, unknown>): PathBearing[] {
const refs: PathBearing[] = []
const rel = (field: string, v: unknown) => {
if (typeof v === "string") refs.push({ field, p: v })
}
for (const s of (manifest["scores"] as string[]) ?? []) rel("scores", s)
for (const sk of (manifest["skills"] as { path: string }[]) ?? []) rel("skills", sk.path)
const templates = manifest["templates"] as Record<string, { path: string }> | undefined
if (templates) for (const t of Object.values(templates)) rel("templates", t.path)
const corrector = manifest["corrector"] as { paths: string[]; integrity: string } | undefined
if (corrector) {
for (const c of corrector.paths ?? []) rel("corrector.paths", c)
rel("corrector.integrity", corrector.integrity)
}
for (const c of (manifest["curricula"] as string[]) ?? []) rel("curricula", c)
for (const c of (manifest["payload_schemas"] as string[]) ?? []) rel("payload_schemas", c)
for (const b of (manifest["benchmarks"] as string[]) ?? []) rel("benchmarks", b)
const verification = manifest["verification"] as { contract: string } | undefined
if (verification) rel("verification.contract", verification.contract)
const firstTask = manifest["first_task"] as { declaration: string } | undefined
if (firstTask) rel("first_task.declaration", firstTask.declaration)
return refs
}

/** Lint one pack dir. Never throws: findings are the interface. */
export function lintPackDir(dir: string): PackLintResult {
const manifestPath = path.join(dir, "PACK.toml")
const findings: PackLintFinding[] = []

if (!fs.existsSync(manifestPath)) {
return { dir, id: "<no manifest>", seeded: false, exerciseLevel: undefined, findings: [{ kind: "schema", detail: "no PACK.toml" }] }
}

const validation = validateFile(manifestPath, "pack")
if (!validation.ok) {
findings.push({ kind: "schema", detail: validation.errors.join("; ") })
}

let manifest: Record<string, unknown> = {}
try {
manifest = parseToml(fs.readFileSync(manifestPath, "utf8")) as Record<string, unknown>
} catch (e) {
findings.push({ kind: "schema", detail: `unparsable TOML: ${e instanceof Error ? e.message : String(e)}` })
return { dir, id: "<unparsable>", seeded: false, exerciseLevel: undefined, findings }
}

// Reference resolution: every path-bearing field resolves, dangling = named.
for (const { field, p } of collectReferences(manifest)) {
const resolved = path.resolve(dir, p)
if (!fs.existsSync(resolved)) {
findings.push({ kind: "dangling-ref", detail: `${field}: ${p} does not resolve (${resolved})` })
}
}

// The seeded check: full domain key set AND a clean manifest.
for (const key of DOMAIN_KEYS) {
if (!(key in manifest)) {
findings.push({ kind: "missing-domain-key", detail: `${key} absent — not a seeded domain pack (formalized/legacy packs omit it by design)` })
}
}
const exerciseLevel = (manifest["first_task"] as { level?: "shakedown" | "substrate" } | undefined)?.level

return {
dir,
id: String(manifest["id"] ?? "<no id>"),
seeded: findings.length === 0,
exerciseLevel,
findings,
}
}

/** Lint every pack under the ordered roots — the acceptance's validator. */
export function lintPacks(roots: string[]): PackLintResult[] {
const results: PackLintResult[] = []
for (const root of roots) {
if (!fs.existsSync(root)) continue
for (const entry of fs.readdirSync(root, { withFileTypes: true })) {
if (!entry.isDirectory()) continue
const dir = path.join(root, entry.name)
if (fs.existsSync(path.join(dir, "PACK.toml"))) results.push(lintPackDir(dir))
}
}
return results
}
Loading
Loading