Skip to content

refactor(apijson): render the differential record's figures from the baseline at docs build time - #2119

Merged
HuiJun merged 5 commits into
developfrom
refactor/rendered-baseline-figures
Nov 11, 2026
Merged

HuiJun merged 5 commits into
developfrom
refactor/rendered-baseline-figures

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What and why

docs/project/api-json-differential.md restated the baseline's figures by hand — the **Scorecard:** headline, the per-root table, and the figure columns of the present-different, pilot-missing and launch-ready gap tables — and TestRecordStatesTheBaselinesFigures checked the restatement. Every re-recording of docs/project/api-json-differential-baseline.json therefore rewrote the page too, and two branches re-recording it conflicted on the numbers as soon as the first merged (the baseline changed in 77 of develop's last 413 first-parent commits, the page in 45).

The figures now leave git:

  • The page carries <!-- doc-counts:begin apijson-… --> blocks. The scorecard and roots blocks hold a sentence; the three table blocks hold the hand-written adjudication rows keyed by (metaclass, property) with no figure column.
  • go run -C tools ./cmd/pilot-apijson-diff -site-blocks (new, tools/referee/apijson/docfigures.go) renders the blocks from the committed baseline — the headline, the per-root table, and each table with its figure columns filled in; the launch-ready table is ranked by ours-missing and numbered at render time.
  • scripts/mkdocs_suite_figures.py runs every generator in COMMANDS (doc-counts and the referee) and splices the text in when the site builds, refusing a block rendered twice.
  • TestRecordStatesTheBaselinesFigures now checks the generator: the committed page states no headline and no gap figure, and the rendered page states the baseline's totals, every root's row and the top-25 ours-missing gaps in rank order. TestRenderBlocksFillsTheFiguresAndRefusesACommittedOne pins the rendering on a small report and the refusals (a figure typed into a sentence block, a figure column committed, a row the baseline lacks, a duplicated or unterminated block).
  • The page moves from exclude_docs to not_in_nav in mkdocs.yml, so the site publishes the rendered record beside the pilot differential; it had no consumer otherwise. Flagging this: it is the one visible policy change here.

The adjudication (which gaps are known, why, the in-flight overlap and derivation clause per row, the re-recording history) stays hand-written and committed. Rendering also surfaced that the committed per-root and pilot-missing tables had drifted from the baseline unnoticed (no test covered them); rendered, they cannot.

Composes with #2084 (refactor/apijson-baseline-fragments, still open): this branch is cut from develop and reads the baseline through one seam, readCommittedReport, which that PR's fragment reader replaces (Totals from the folded index, Scorecard from the fragments, Roots from the per-root summaries). The two will conflict only in doc_counts_test.go's reader lines and that seam.

Measured: pairwise conflicts on the page, last 10 develop merges that touched it

Method: the 10 most recent first-parent merges into develop touching the file; each merged PR head unwound to its last commit before it re-merged develop (the pre-merge head); then every pair (45) merged in a scratch tree. "Before" is git merge-tree --write-tree on the actual trees; "after" is git merge-file on the three versions of the page with the figures the build now renders removed (the same transformation this PR applies), since the historical trees cannot be re-rendered.

file pairs conflicting before conflicting after
docs/project/api-json-differential.md 45 7 3

The 3 residual conflicts are two PRs each inserting a hand-written "Re-recorded on …" paragraph directly under the headline — adjacent prose insertions, which no layout of the figures resolves and which stay hand-written by design. For context, the baseline JSON itself conflicted in 9 of the same 45 pairs; #2084's fragments address that file.

How it was verified

  • go test -C tools ./referee/apijson (both tests above), go run -C tools ./cmd/doc-counts -check (already current), go run -C tools ./cmd/pilot-apijson-diff -site-blocks prints the five blocks.
  • python3 scripts/mkdocs_suite_figures-test.py (6 tests, including the real baseline rendering into the real record) and the other scripts/*-test.py that read mkdocs.yml.
  • mkdocs build --strict: the built project/api-json-differential/index.html carries Scorecard: 935 files; 105427 elements matched … and no marker.
  • go build ./..., go vet ./..., go vet -C tools ./..., gofmt -l empty, make lint, go test ./tests/hygiene.

Checklist

  • make test and make lint pass locally (lint; the relevant test packages and hygiene suite — the full race suite runs in CI)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (AGENTS.md §6.1/§6.2, CONTRIBUTING.md documentation conventions)
  • Changelog entry added as changes/unreleased/api-json-record-rendered-figures.changed.md
  • No baseline moved; make docs-counts stays current
  • No internal work-item labels in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/db2463db486544eb9f5b9e5a8389e7c3
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/db2463db486544eb9f5b9e5a8389e7c3?variant=devin
Requested by: @HuiJun


🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 2 commits November 11, 2026 02:36
…baseline at docs build time

The scorecard headline, the per-root table and the figure columns of the
present-different, pilot-missing and launch-ready gap tables of
docs/project/api-json-differential.md were restated by hand and checked by
TestRecordStatesTheBaselinesFigures, so every re-recording of the baseline
rewrote the page and two branches re-recording it conflicted on the numbers.

The page now carries doc-counts blocks: a sentence for the headline and the
root table, and the hand-written adjudication rows keyed by (metaclass,
property) for the tables. pilot-apijson-diff -site-blocks renders them from
the committed baseline, scripts/mkdocs_suite_figures.py splices them in when
the site builds (it now runs every generator in COMMANDS), and the referee
test checks the generator against the baseline and refuses a figure typed
into a block. The per-root and pilot-missing tables had drifted from the
baseline unnoticed; rendered, they cannot.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…endered figures

The page was excluded from the site, so the blocks the build renders had no
consumer; it joins the pilot differential among the published records that
are not in the navigation.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 2 commits November 11, 2026 02:43
…fails

on_pre_build rendered every generator in one call, so a failing
pilot-apijson-diff dropped the test inventory's figures as well; each
generator now renders on its own and a failure loses only its blocks.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

…baseline-figures

Co-Authored-By: jason.han <hanhuijun@gmail.com>

# Conflicts:
#	tools/referee/apijson/doc_counts_test.go
#	tools/referee/apijson/main.go
@HuiJun
HuiJun merged commit c708674 into develop Nov 11, 2026
31 of 53 checks passed
@HuiJun
HuiJun deleted the refactor/rendered-baseline-figures branch November 11, 2026 13:22
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