Floor-then-ica C4: keying with the parent and DerivedFrom lineage

Open
#2,700 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend, database

Research direction

Read the floor-then-ica plan (#2584), ADR 0148, and the related C3 work in #2590; inspect the derivative and grid tests that run on Miniflare D1. Trace how derivative inputs, floor decisions, recipe lineage, and parent state are read and written. Done means those tests cover each keying refusal condition, DerivedFrom, waiting_on, parent_superseded, and expired parents.

Written by the indexing model from the issue text.

Description

Card C4 of the floor-then-ica plan (#2584, ADR 0148): a child derivative (nemar-ica) is keyed only when its parent floor derivative is attested, and its lineage is written where readers find it.

What it needs

  • Keying checks: a child stamp is keyed only when its job's specification named the parent in derivative_inputs, the staged file's SHA-256 matches the parent's file, and no recording row ended floor_refused at floor_decisions (a run-level floor refusal writes nothing, nemarOrg/nemar-process#140). Otherwise the stamp is unkeyable with a stated reason.
  • parent_key on the stamp and the derivative row equals the parent row's key (columns from #2590; written by C3).
  • DerivedFrom in derivative.json: the parent recipe, version and key, and the decisions file's digest. The child's own key lines do not change while one ICA version pins one floor version.
  • Cross-check with the recipe's own lineage: the ICA record's extensions.nemar.ica.floor (source, recipe, file_sha256, plan_hash, input_digest, image_digest) and the dataset record's extensions.nemar.floor agree with the staged file; a mismatch is not keyed.
  • Grid waiting_on: a row waiting for its parent shows waiting_on (derived on read, nothing stored).
  • Staleness on read: a newer floor marks the ICA derivative parent_superseded; an expired parent leaves parent_key pointing at an expired row (the decisions are also in ICA's own product).

Acceptance

Derivative and grid tests on Miniflare D1 with real rows: keyed with its parent, refused for each missing condition, DerivedFrom written, waiting_on and parent_superseded shown on read.

Posted with the help of an AI agent (Claude).

Dominant language
TypeScript
Stars
0
Forks
1
Avg merge
4h 48m
Merged PRs (30d)
468

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nemarOrg/nemar-cli

All issues in nemarOrg/nemar-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.