Skip to content

Phase 5 N1: plugin checkpoints in the nemar-ica map - #2339

Merged
neuromechanist merged 12 commits into
feature/issue-2324-epic-pipeline-progressfrom
feature/issue-2324-n1-plugin-maps
Nov 23, 2026
Merged

neuromechanist merged 12 commits into
feature/issue-2324-epic-pipeline-progressfrom
feature/issue-2324-n1-plugin-maps

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Phase 5 N1, the nemar-cli side of the quality plugins (ADR 0134 decisions 6 and 7). The nemar-process side (plugin runner P1, dataQuality document P2, plugins P3a/P3b, wiring P4) follows; P4 re-pins nemar-process to this PR's merged commit.

  • nemar-ica's checkpoint map gains quality (nemar-quality) and figures (nemar-spectrum, nemar-components, nemar-segment) after iclabel. The step record now counts at figures. nemar-floor is unchanged.
  • RECIPE_PLUGIN_STEPS names the plugin steps. They are step words (PROGRESS_STEP_RE) and valid manifest names, mapped only in nemar-ica, at quality or figures.
  • shared/contract/compute-progress-vectors.json is regenerated (NEMAR_WRITE_PROGRESS_VECTORS=1): the map changes, and ica_mixed gains a failure at nemar-quality, a skip at nemar-spectrum and a failure at nemar-segment; g.set (record) now counts at figures.
  • New shared/contract/plugin-manifest-vectors.json, generated by test/plugin-manifest-vectors.unit.test.ts (NEMAR_WRITE_PLUGIN_VECTORS=1): manifests with the schema verdict (Ajv on the shared schema and zod agree) and the pluginManifestProblem word, covering bounds_reversed, quality_without_metric, figures_without_figure, a time-series SVG refusal, a map SVG acceptance and other refusals, for nemar-process to replay.
  • test/compute-recipes-process-drift.unit.test.ts reads nemar-process's PLUGINS = (("name", "version"), ...) literal. Until a steps.py declares it (nemar-process dev and its epic branch today), the CHECKPOINTS comparison leaves the registry's plugin steps out; once declared, its names must equal the map's plugin steps in order and its CHECKPOINTS the whole map.

Owner answers (2026-11-23)

  • Plugins run only in nemar-ica now; floor-compatible plugins are a follow-up within Phase 5.
  • A plugin that fails is recorded as skipped in the record and the recording keeps its decomposition, so a recordings-table row names a plugin step only when the recording failed in a way the runner does not absorb; the vectors still pin the counting of a failure and a skip at a plugin step.
  • Bounds as percentages.
  • Raise resultLimits.maxFiles for nemar-ica: NOT done in this PR, see below.

Test plan

  • bun test test/compute-recipes.unit.test.ts test/compute-checkpoints.unit.test.ts test/compute-recipes-process-drift.unit.test.ts test/plugin-manifest-contract.unit.test.ts test/plugin-manifest-vectors.unit.test.ts test/compute-admin-contract.unit.test.ts test/admin-compute-pipeline-cli.test.ts test/contract-schemas.test.ts test/compute-progress-contract.unit.test.ts: 387 pass, 3 skip, 0 fail
  • Backend compute-pipeline-grid, compute-progress-reconcile, compute-progress-route: 70 pass (the grid reads columns from the registry; nothing in backend/src or src names nemar-ica)
  • Drift test with NEMAR_REQUIRE_PROCESS_RECIPES=1 against nemar-process origin/dev and origin/feature/issue-65-epic-pipeline-progress: 11 pass each
  • Drift test against a simulated P4 tree (PLUGINS declared, CHECKPOINTS with quality and figures): 11 pass; mutations fail it: PLUGINS order swapped, PLUGINS declared without the plugin checkpoints, nemar-quality moved to figures
  • Mutations: no bounds rule in pluginManifestProblem (2 fail in the vectors test); nemar-quality mapped at figures (2 fail)
  • bun run typecheck, bun run lint, Biome on the touched files, changelog format test
  • CI
  • Not run: the full bun test (epic to dev gate)

Update 2026-11-23: owner direction, review round 1

Figures held (owner direction). Stored figure images are being replaced by live browser rendering from data, so the figures checkpoint and its three plugin steps are removed from the map and the vectors for now. nemar-ica's map ends quality (nemar-quality); RECIPE_PLUGIN_STEPS is ["nemar-quality"]; record counts at quality. The earlier bullets about figures above are superseded.

I2, per-recipe result limit (owner decision). A registry entry may declare resultLimits.maxFiles. resultMaxFilesFor (backend compute-records.ts) gives a NEMAR pipeline job (source = pipeline, named by a pipeline stamp) its recipe's own value, capped at COMPUTE_MAX_OUTPUT_FILES (100,000); every other job, a person's and a partner's included, keeps the owner's policy resultLimits.maxFiles. It is used by the outputs route's count check, its body cap (outputsBodyCap(env, job)), the launcher file caps and the launcher-document bound (launcherDocumentLimit(env, job), all callers pass the job). nemar-ica: 25,000 (about 13 files per recording now, so 5,000 stopped at about 384 recordings; 25,000 admits about 1,920, headroom over 1,000 and room for figure files later). nemar-floor: 25,000 too, because its own count needs it (6 files per recording plus 3 for the dataset: 5,000 stopped at about 830 recordings, below some auto-dispatched datasets; 25,000 admits about 4,160). maxBytes is not added: the route's job byte limit (20 GiB policy) is not what binds. Launcher check (nemar-process epic branch): MAX_OUTPUT_FILES = 100_000 agrees with the ceiling, but the launcher caps its outputs REQUEST at OUTPUTS_REQUEST_MAX_BYTES = 1 MiB (about 8,000 ordinary entries) and fails a bigger one too_many_outputs itself, so a job over that never reaches the Worker: raising it (for example derived from max files, under the Worker's 64 MiB body ceiling; 25,000 entries at the Worker's 1,700-byte worst case is about 42.5 MB) is a nemar-process change. The launch spec's limits are the dataset STAGING limits (LAUNCH_DATASET_LIMITS), not outputs, so nothing there carries this value.

I1, plugin skips counted per checkpoint (decided, lead), adapted to the existing column. nemar-process already writes a skipped_steps column in every recordings table (step:reason pairs joined by COMMAS, for steps a rule skipped, e.g. bad_windows:too_short). A new semicolon column under the same name would have collided and made every floor table with a rule skip unreadable. So the rule reads that column: only pairs whose step is one of RECIPE_PLUGIN_STEPS count; a succeeded row is skipped at the checkpoint holding a listed plugin step (code and step carried, listed among that checkpoint's failures) and passed elsewhere; a skipped plugin never makes a later checkpoint skipped; totals still sum. The column is optional (absent = empty); a malformed plugin pair (no reason, a reason outside the failure-code pattern, a plugin named twice) is refused bad_skipped_steps; other steps' pairs are left alone; non-succeeded rows' cells are not read. A plugin absorbed by the runner via plan.add_skip lands in this column already. The vectors drop the plugin-step failure and skip rows (a recording fails at a plugin step only for a fault the runner does not absorb, which nemar-process has not defined, so no row) and add a succeeded row with nemar-quality:plugin_failed. The two-checkpoint case waits for the figures design. The Phase 4a grid's complete reads passed = total at the last checkpoint, now quality, so a recording with a skipped plugin is not complete (pinned in the counting test); its drill-down unlisted stays right because plugin skips can only add at the last checkpoint today.

S3. The drift test fails when ^PLUGINS is assigned in a form it cannot read (a list).
S4. Manifest vectors gain bounds_equal (min == max, valid) and bounds_reversed_before_figures_without_figure (rule precedence: bounds_reversed), and a test that the document root accepts the checkpoint_iclabel manifest that #/$defs/PluginManifest refuses.
S5. nemar-ica stays 1.0.0-b1 (placeholder, autoDispatch: false); any existing nemar-ica 1.0.0-b1 stamp is reconciled against the new map, whose last checkpoint is quality, so it reads not complete.

Round 1 test plan

  • Root: recipes, checkpoints, drift, manifest contract and vectors, admin contract, pipeline CLI, contract schemas, progress contract, changelog format: 398 pass, 3 skip, 0 fail
  • Backend: job callbacks (incl. a nemar-ica pipeline job with 5,001 outputs accepted under the policy's 5,000 while a person's 5,001 is refused; a stamp-less pipeline job, an unknown recipe and a person's job a stamp names all keep the policy; body cap and launcher-document bound follow the job), pipeline grid, progress reconcile and route, lifecycle, runner jobs and queue, results routes: 417 pass, 0 fail
  • Drift with REQUIRE against nemar-process dev, the epic branch and a simulated P4 (quality only): 11 pass each; a list-form PLUGINS, PLUGINS without the quality checkpoint, and another plugin name each fail it
  • Mutations: limit ignores the source (1 fail); recipe limit never used (3 fail); skipped_steps ignored in outcomes (2 fail); no duplicate-plugin check (1 fail)
  • typecheck, lint, Biome
  • Not run: the full bun test

Part of epic #2324

Review round 2 (delta, four items)

  • parseSkippedSteps trims each step and reason (a:b, nemar-quality:plugin_failed and nemar-quality :plugin_failed count the plugin skip); tested, and the test fails without the trim.
  • resultMaxFilesFor lets a recipe's own value RAISE the limit, never lower it (Math.max(policy, min(own, 100,000))), docblock updated; a test with the policy at 30,000 above nemar-ica's 25,000 gives the pipeline job 30,000, and fails with the old replace rule. The changelog says so.
  • The vacuous passed === total assertion is dropped from the counting test; the grid's complete rule (a last-checkpoint progress row with passed < total counts as not complete) is already exercised by backend/test/compute-pipeline-grid.test.ts "covered, complete and covered at any recipe version".
  • JOB_PIPELINE_RECIPE_SQL and resultMaxFilesFor moved above the outputsBodyLimitBytes docblock, which sits on its function again.
  • Gates: root counting, recipes, drift and manifest vectors 121 pass, 3 skip; backend job callbacks, pipeline grid, progress reconcile, lifecycle 218 pass; typecheck, lint, Biome clean. Not run: the full bun test.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2339

Version: 0.10.40-PR2339.966a1af
Commit: 966a1af


🤖 Updated on each push.

@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review: r1 code+tests+errors+types, findings I1, I2, S3-S5 fixed; r2 delta (code+tests+errors) clean with four low items, all fixed in 465420b..966a1af. Targeted tests rerun on 966a1af: 119 pass, 3 skip, 0 fail. Merging into the epic branch per the phase-to-epic gate; full CI runs at epic to dev.

@neuromechanist
neuromechanist merged commit 3801e40 into feature/issue-2324-epic-pipeline-progress Nov 23, 2026
1 check passed
@neuromechanist
neuromechanist deleted the feature/issue-2324-n1-plugin-maps branch November 23, 2026 16:20

This branch was previously deployed

1 inactive deployment
npm — 966a1af7 Deployed Nov 23, 2026 by neuromechanist via publish #4809
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant