Skip to content

Judgment record store: persist judgments once, load them at every citing site - #26

Merged
mzargham merged 25 commits into
mainfrom
judgment-record-store
Oct 2, 2026
Merged

mzargham merged 25 commits into
mainfrom
judgment-record-store

Conversation

@mzargham

@mzargham mzargham commented Oct 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds src/toaster/judgment_store.py (save_record/load_record/records_citing), a persisted JSON store under decisions/judgment-records/ for ReviewRecord judgments (DL-097, DL-098).
  • Every chapter that originates a cited-forward judgment (Ch2, Ch3, Ch4, Ch6, Ch8) now persists it at the cell where it's made.
  • Every chapter that cites one forward (Ch9, Ch10) now loads it instead of retyping it by hand or, for Ch10's AI-C06, re-deriving it via live queries -- closing the "string writing that should be retrieved, not defined" gap Z flagged after the diagram-text-integration PR.
  • Ch10 also gets two independent authoring-bug fixes (generating traceability-graph/premises facts from existing queries instead of hand-typed literals) and one new DEFERRED.md entry (D-038, OpenSysML's missing subjectParameter key on RequirementDefinition).
  • Full gap analysis, decision history, and completion record: decisions/log.md DL-097, DL-098, DL-099.

Test plan

  • uv run pytest tests/ glossary/tests/ -q -- 448 passed, 7 deselected
  • uv run python scripts/check_construction.py --check -- all 10 chapters consistent
  • uv run python -m glossary check -- 0 errors
  • Every one of the 9 implementation contracts independently reviewed on a different model than its builder, per decisions/work-contract-template.md

… own decision

Persist ReviewRecord once where authored, load it where cited, instead of
retyping it by hand. Phase A (survey of originating chapters) gets its own
plan next; Phase B (implementation) waits for Phase A's real findings.
Fully self-contained -- every agent's dispatch prompt is written out in
full, per writing-plans' own no-placeholder rule. States explicitly, on
disk, that completing this plan triggers writing Phase B's own plan next.
All 8 chapter-survey agents reported in. Confirmed originating cells for
all 8 cited-forward identifiers (AC-001, AC-C03, AS-C03, AI-C04, AC-C06,
AS-C06, AI-C06, AS-C08). One new finding beyond DL-097's own scope: a
4th retyped copy of AS-C08, inside Ch8 itself (not Ch9/Ch10), flagged as
a cross-chapter open question rather than folded into scope silently.
Also flagged: no originating cell currently gates on validate_record()
passing except Ch8's AS-C08 -- needs a design-reading confirmation before
Phase B's contracts are written.
… Ch8's own AS-C08 duplicate; insert save_record() unconditionally
…tasks

Uses decisions/work-contract-template.md's own exact CONTRACT field format
for every task, not a simplified version. Real sequencing dependencies
(Task 1 first, then Tasks 2-6 in parallel, then Tasks 7-8), not the fully-
parallel shape the diagram-text-integration Phase B used -- this feature
has real load-bearing dependencies between origin and citing chapters.
…ries, not literals

01-traceability-graph.ipynb cell 17's "allocation" strings and
03-engineering-signoff.ipynb cell 19's first premises bullet each hand-typed a
fact a prior cell in the same notebook had already computed into a live
variable (heatgen_allocations/toaster_allocations; coverage/ties/
tied_to_a_requirement). Both now generate that text from the query result
directly, so a later drift in the model can't silently diverge from the
printed claim. Confirmed by live execution that the generated text still
states the same real facts the removed literals stated.
…efinition

DL-097 found this gap but it had no DEFERRED.md entry (confirmed: zero hits
for subjectParameter/sourceText before this commit). 01-traceability-graph.ipynb
cell 8's requirement_subject() works around it by reading sysx:sourceText
instead of a structural field; the workaround is correct and already in
place, this just tracks the upstream gap and points at it from the cell.
…d it instead of a 2nd retype in 03-revision-flow
…etyping or re-querying them

AS-C06 and AS-C08 were hand-retyped verbatim from their Chapter 6/8
originals; both now come from load_record() against the persisted
store instead.

AI-C06 was built differently: by re-running live queries
(perform_relationships, find_allocations, model.eval) against a
freshly loaded Chapter 6 model, rather than retyped. DL-097 called
this "the better pattern" relative to retyping AS-C06/AS-C08. This
commit replaces that pattern too. The live-requery approach was
better than retyping only because, at the time, there was no
persisted store for AI-C06 to be loaded from -- re-deriving its
evidence from the model was the only way to avoid a stale hand
copy. Now that AI-C06 itself is persisted at its own origin
(Chapter 6, Task 5 of this initiative), re-deriving it from scratch
via live queries every time it's cited is itself a redundant
pattern once the store exists, per the judgment-record-store design
spec's own Decision 4 ("loaded, never re-typed, at the point of
citation"). The same construct-once/query-thereafter principle that
replaced retyping also replaces re-querying.

Cell 10 (the perform_relationships/find_allocations/model.eval cell
that only existed to feed AI-C06's construction) is removed
entirely, since nothing else in the notebook references its
performs/allocations/rated_holds/weak_holds results.

Also updates the notebook's own markdown narration (cells 1, 5, 7,
9, and the cell right after the removed one) to describe records as
loaded via load_record() from what each origin chapter persisted
with save_record(), instead of reconstructed, rebuilt, recomputed
or assembled here -- the prior wording described a mechanism this
notebook no longer has.
…I-C06 instead of retyping or re-querying them
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@mzargham
mzargham merged commit f9dcddf into main Oct 2, 2026
2 checks passed
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