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
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,12 @@ on three draws with false transitions at ownship's turns, one leg 27%); a turn d
turn: Debrief blind (31.9%), independent slices 1.4%, joined legs 3.1% (instant knot placed late);
held course: no false split. No splitter wins everywhere. Slides
`site/blog/2026-11-21-leg-splitters-slides.md`; next is the owner's choice.
Follow-up 2026-11-22 (owner's review): arrowheads at track ends; an optional course & speed chart
(both vessels, estimate dashed; true turns shaded, detected turns as edge strips: target orange
right, ownship teal left, only Debrief detects ownship turns, `splitter_ownship_spans`); the error
chart's quantity as a drop-down; the Preset drop-down shows the matching preset or "custom"; a
waypoint drag keeps the adjacent legs' speeds (`moveWaypoint(..., "speed")`; the square keeps
duration); ctrl-click deletes a waypoint. Schema 0.39.0.

## Stack (owner decisions, 2026-10-31)

Expand Down
23 changes: 23 additions & 0 deletions conformance/onnx/demo_node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ async function solveScenario(sc, name = sc.solver) {
}

// ---------- tracks ----------
test("spec 036 follow-up: a waypoint drag that keeps speed changes the adjacent legs' durations, not their speeds", () => {
const tr = preset("good-geometry").ownship;
const W0 = T.waypoints(tr);
const moved = T.moveWaypoint(tr, 2, W0[2][0] + 1, W0[2][1] - 0.5, "speed");
const W1 = T.waypoints(moved);
for (const j of [0, 1, 3, 4]) assert.ok(Math.hypot(W1[j][0] - W0[j][0], W1[j][1] - W0[j][1]) < 1e-9, `waypoint ${j} stayed`);
for (const i of [1, 2]) {
assert.ok(Math.abs(moved.legs[i].speed_kt - tr.legs[i].speed_kt) < 1e-9, `leg ${i} kept its speed`);
const len = Math.hypot(W1[i + 1][0] - W1[i][0], W1[i + 1][1] - W1[i][1]);
assert.ok(Math.abs(moved.legs[i].duration_s - (len / tr.legs[i].speed_kt) * 3600) < 1e-6, `leg ${i} duration follows its length`);
}
assert.equal(moved.legs[0].duration_s, tr.legs[0].duration_s);
assert.equal(moved.legs[3].duration_s, tr.legs[3].duration_s);
});

test("waypoint drag moves only the adjacent legs (FR-002)", () => {
const tr = preset("good-geometry").ownship;
const W0 = T.waypoints(tr);
Expand Down Expand Up @@ -298,6 +313,14 @@ test("held course: no arctan splitter states a manoeuvre (good geometry, endfire
}
});

test("spec 036 follow-up: Debrief's splitter states the ownship turns it found, between its steady legs", async () => {
const sc = preset("two-target-turns");
const { r } = await split(sc, "arctan-debrief");
const own = T.manoeuvres(bearings(sc).paths.own);
assert.equal(r.ownship_spans.length, own.length);
r.ownship_spans.forEach((f, i) => assert.ok(Math.abs((f.start_s + f.end_s) / 2 - (own[i].t0 + own[i].t1) / 2) < 30, `ownship turn ${i}`));
});

test("two target turns inside ownship legs: joined legs find both, Debrief one, independent slices land between", async () => {
const sc = preset("two-target-turns");
const j = await split(sc, "arctan-joined");
Expand Down
34 changes: 33 additions & 1 deletion conformance/onnx/demo_page.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,33 @@ try {
await page.waitForTimeout(50);
const und = await state();
check("Delete removes a waypoint and undo restores it (FR-004, FR-007)", del.sc.ownship.legs.length === after.sc.ownship.legs.length - 1 && JSON.stringify(und.sc.ownship) === JSON.stringify(after.sc.ownship));

// spec 036 follow-up: the waypoint drag kept the adjacent legs' speeds; ctrl-click deletes a waypoint
const keptSpeed = [1, 2].every((i) => Math.abs(after.sc.ownship.legs[i].speed_kt - before.legs[i].speed_kt) < 1e-6) && [1, 2].some((i) => Math.abs(after.sc.ownship.legs[i].duration_s - before.legs[i].duration_s) > 1);
check("a waypoint drag keeps the adjacent legs' speeds and changes their durations (spec 036 follow-up)", keptSpeed, [1, 2].map((i) => [before.legs[i].duration_s, after.sc.ownship.legs[i].duration_s]));
await page.locator("[data-testid=wp-ownship-2]").click({ modifiers: ["Control"] });
await page.waitForTimeout(50);
const cdel = await state();
check("ctrl-click deletes a waypoint (spec 036 follow-up)", cdel.sc.ownship.legs.length === und.sc.ownship.legs.length - 1);
await page.keyboard.press("Control+z");
await page.waitForTimeout(50);
await settled();

// spec 036 follow-up: arrows at the tracks' ends, the preset shown, the error quantity as a drop-down, course and speed
const arrows = await page.locator("[data-testid=arrow-ownship], [data-testid=arrow-target]").count();
const shownPreset = await page.locator("[data-testid=preset]").inputValue();
check("an arrowhead at each track's end; the preset drop-down shows custom after an edit (spec 036 follow-up)", arrows === 2 && shownPreset === "custom", { arrows, shownPreset });
await page.selectOption("[data-testid=preset]", "good-geometry");
await settled();
const shown2 = await page.locator("[data-testid=preset]").inputValue();
await page.selectOption("[data-testid=error-quantity]", "range");
const ylab = await page.locator("[data-testid=chart-error]").innerHTML();
let kin = await page.locator("[data-testid=chart-course]").count();
await page.selectOption("[data-testid=kinematics-quantity]", "speed");
kin += await page.locator("[data-testid=chart-speed]").count();
const hErr = (await page.locator("[data-testid=chart-error]").boundingBox()).height, hBrg = (await page.locator("[data-testid=chart-bearings]").boundingBox()).height;
check("preset shown; error quantity by drop-down with the chart as tall as its neighbours; course and speed charts (spec 036 follow-up)", shown2 === "good-geometry" && /range error/.test(ylab) && kin === 2 && Math.abs(hErr - hBrg) < 2, { shown2, kin, hErr, hBrg });

await settled();

// acceptance 5: the URL restores the exact scenario and solution
Expand Down Expand Up @@ -170,7 +197,12 @@ try {
const cmpRows = await page.locator("[data-testid=compare-table] tbody tr").count();
const cmpState = await page.evaluate(() => { const c = window.__demo.compare(); return { status: c.status, done: Object.keys(c.rows) }; });
check("compare runs each splitter through the layer and tabulates them", cmpState.status === "done" && cmpState.done.length === 5 && cmpRows === 5, cmpState);
if (process.env.DEMO_SHOT) await page.screenshot({ path: process.env.DEMO_SHOT, fullPage: false });
if (process.env.DEMO_SHOT) {
await page.selectOption("[data-testid=splitter]", "arctan-debrief");
await page.waitForTimeout(50);
await settled();
await page.screenshot({ path: process.env.DEMO_SHOT, fullPage: false });
}

// the whole-period learned model in the browser, with its progress shown while it loads
await page.selectOption("[data-testid=preset]", "target-turn");
Expand Down
5 changes: 4 additions & 1 deletion schema/tma.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >-
principle I). Frame: local flat-earth Cartesian, x east, y north, metres, origin at ownship's
window-start position. Bearings and courses are true, clockwise from north, radians in [0, 2π).
Speeds in m/s. Times in seconds since window start. All stored floats are float32-rounded.
version: 0.38.0
version: 0.39.0
license: Apache-2.0
prefixes:
linkml: https://w3id.org/linkml/
Expand Down Expand Up @@ -2251,6 +2251,7 @@ classes:
manoeuvre_prob: { range: float, multivalued: true, description: "The solver's probability that a target manoeuvre is in progress at each of manoeuvre_t_s." }
splitter: { range: string, description: "Spec 036: the leg splitter whose spans the solver used." }
splitter_spans: { range: DemoSpan, multivalued: true, inlined_as_list: true, description: "Spec 036: the manoeuvre spans the leg splitter stated, in the problem's time." }
splitter_ownship_spans: { range: DemoSpan, multivalued: true, inlined_as_list: true, description: "Spec 036 follow-up: ownship turns the leg splitter detected, in the problem's time (only a splitter that detects them, as Debrief's slicing)." }
splitter_runtime_ms: { range: float }
splitter_message: { range: string }

Expand All @@ -2262,6 +2263,8 @@ classes:
label: { range: string }
assumptions: { range: string, required: true, description: "Its method, in words." }
told_truth: { range: boolean, required: true, description: "It is told the true manoeuvre spans (an oracle)." }
detects_target: { range: boolean, description: "Spec 036 follow-up: it states target manoeuvres." }
detects_ownship: { range: boolean, description: "Spec 036 follow-up: it states ownship turns it detected." }

DemoSolverInfo:
description: "Spec 035 FR-024: what a solver plug-in declares."
Expand Down
24 changes: 24 additions & 0 deletions site/blog/2026-11-21-leg-splitters-kickoff.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,27 @@ This is spec 036.
- A track plot of the two-turn preset with each splitter's track and knots.
- Data: `scripts/research/demo_splitters.mjs` on the page's own presets, recorded in
`experiments/20261121-demo-splitters/`.

## Updates

- 2026-11-22: from the owner's review of the merged demo:
- An arrowhead at the end of each track shows which way it is heading.
- A fourth optional chart, "course & speed", shows both vessels' course or speed (a drop-down:
course, speed or both) with the estimate dashed. True turns are shaded (blue ownship, red
target); turns a splitter detected are solid strips: orange target turns on the right edge,
teal ownship turns on the left. Only Debrief's slicing detects ownship turns, so only it
draws the teal strips.
- The error chart's quantity is a drop-down, so the chart is as tall as its neighbours and
their time axes line up.
- The Preset drop-down shows the preset the scenario matches, or "custom" once edited.
- Dragging a waypoint (circle) now keeps the adjacent legs' speeds, so their durations change.
Dragging a leg's square keeps its duration, so its speed changes.
- Ctrl-click (⌘-click) deletes a waypoint.
- Each leg's speed label sits on the leg's north side (west for a north–south leg), clear of
the square handle and the cursor that drags it. The read-out during a drag sits above and
to the left of the cursor. It says what is kept and what changes: "Keeping time: speed
changes" for a square (the leg's minutes, its old and new speed and course), "Keeping speed:
leg times change" for a circle (each adjacent leg's speed, its old and new minutes). The
hover tooltips on squares and circles say the same.
- Schema 0.39.0: `TmaSolution.splitter_ownship_spans`, and the `DemoSplitterInfo` flags
`detects_target` and `detects_ownship`.
Loading
Loading