Skip to content

fix(lifecycle): refuse lifecycle records with a repeated key at any depth - #99

Merged
alphastorm merged 2 commits into
mainfrom
fix/lifecycle-record-duplicate-keys
Nov 14, 2026
Merged

alphastorm merged 2 commits into
mainfrom
fix/lifecycle-record-duplicate-keys

Conversation

@alphastorm

@alphastorm alphastorm commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Rule

The lifecycle verdict reads a run or install record that contains a repeated JSON key at any depth as unreadable, so such a record cannot admit idle or quiescent operation.

Operators see the verdict name the unreadable run or install record and require reconciliation by hand; start, install and idle_generation refuse it at their verdict admission. The verdict's row is unreadable-record, unless the process table is unavailable or an active identity cannot be told, in which case the row is unreadable-table and the record is still named. The runtime's own writer never produces a repeated key. Equal repeated values are refused too.

Limit

This changes the verdict's record reader and therefore what consumes the verdict: status, start, idle_generation and install. Other code still reads the run or install record with the plain JSON reader, which keeps a repeated key's last value: stop, serve, doctor, the start-up steps, the install's fast verification and the real-host gate scripts. They are unchanged here. Moving stop onto the verdict is the next change in this series.

Tests

The role-shape model has 2,660 cells: five roles × seven states × two platform flags × nineteen forms × two survivor conditions. Its 840 added cells repeat pid, created or exe in both orders, including inactive launcher identities; every added cell requires the unreadable verdict and all three consumer refusals.

Twelve additional cells cross run/install records, top-level/object/array-object placements and equal/different repeated values, with the same refusal assertions. These three nesting placements sample recursion; they do not exhaust unbounded JSON trees.

Verification: all four focused modules pass (143 tests). The whole suite is green (1,349 discovered; 1,342 run; ten skips and four expected failures). All checks pass, including eleven document-reader tests, 166 profile/route validations and 164 release manifests. Eight reader mutations are killed by checked-in tests.

Closes #98

- Extend the role-shape product with repeated identity fields in both orders.
- Require admission refusal for duplicate keys at each sampled nesting placement.
- Reject every repeated key through the recursive JSON object-pairs hook.
- Document unreadable records and manual reconciliation, including equal repeated values.
@alphastorm
alphastorm merged commit ccad158 into main Nov 14, 2026
11 checks passed
@alphastorm
alphastorm deleted the fix/lifecycle-record-duplicate-keys branch November 14, 2026 22:23
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.

lifecycle: a repeated field inside a recorded process identity is read as its last value

1 participant