Skip to content

chore(json): canonicalise .hypatia-baseline.json (I-JSON + JCS) and keep it that way - #1304

Merged
hyperpolymath merged 4 commits into
mainfrom
claude/gallant-euler-yinsyw
Oct 19, 2026
Merged

hyperpolymath merged 4 commits into
mainfrom
claude/gallant-euler-yinsyw

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

.hypatia-baseline.json was valid I-JSON but not JCS: it had 516 indented lines and unsorted member names. 3-practice/JSON-POLICY.adoc §6 left this file undecided. On 2026-10-19 the owner ruled that it must be converted. This PR has two commits.

1. chore(json): canonicalise .hypatia-baseline.json

  • I ran ijson-jcs fix with the binary built from the commit CI pins (0fdeea71). The file is now one sorted line ending in LF, which satisfies .editorconfig. Its parsed value is unchanged: jq reads $old == $new as true.
  • No tool rewrites this file in this repo. People and agents edit it by hand or with jq in PRs. Every reader parses it with jq, so the single-line layout breaks no consumer:
    • apply-baseline.sh
    • filter-sarif-by-baseline.sh
    • check-exemption-ratchet.sh
    • the banned-language lookup in governance-reusable.yml
    • tests/test_secret_scanner_no_inherit.sh
  • Docs:
    • JSON-POLICY.adoc §6 records the ruling.
    • HYPATIA-BASELINE-FORMAT.adoc tells editors to run ijson-jcs fix .hypatia-baseline.json after an edit. It also says the indented example there is for reading only.

2. ci(json): block drift on converted JSON (separate commit, so it can be dropped)

Testing

  • check-ijson-jcs.sh --enforce .hypatia-baseline.json exits 0 on this branch and 1 on origin/main's copy.

  • apply-baseline.sh gives byte-identical output on the old and new files, in both advisory and blocking modes. The input had 62 matching findings plus one planted finding that should not match: 62 were suppressed and 1 was kept, in both.

  • check-exemption-ratchet.sh origin/main passes, with .hypatia-baseline.json unchanged at 62 entries.

  • These tests pass:

    Test Result
    exemption-ratchet-test 14/14
    apply-baseline-test 52/52
    check-ijson-jcs-test 31/31
    hypatia-blocking-gate-test pass
    test_secret_scanner_no_inherit pass
  • Workflow checks: actionlint 1.7.7 is clean. validate-sha-pins, validate-actions-lock, check-lock-sync, check-workflow-duplicate-keys, validate-permissions and the actions-lock gate all pass. The pre-commit and commit-msg hooks pass.

  • validate-spdx-workflows fails when run across the whole repo. The failure is on 9-archive/rhodium-standard-repositories/satellites/rsr-deployer/.github/workflows/jekyll-gh-pages.yml, which this PR does not touch. The staged-file run in pre-commit passes.

Trade-off

Because the file is now one line, every future edit shows in a diff as a whole-line change. To review a change, run jq . <file> on both sides and compare those, or use git diff --word-diff.


Generated by Claude Code

The owner ruled that .hypatia-baseline.json must be J-1 canonical, as
JSON-POLICY requires. The file was rewritten with ijson-jcs fix, built
from the commit CI pins (0fdeea71). It is now one sorted line ending in
LF, down from 516 indented lines. The parsed value is unchanged: jq
reads both versions as equal.

No tool rewrites the file here. It is edited by hand or with jq in PRs,
and every reader parses it with jq, so the single-line layout breaks
nothing:
- apply-baseline.sh
- filter-sarif-by-baseline.sh
- check-exemption-ratchet.sh
- the banned-language lookup in governance-reusable.yml
- tests/test_secret_scanner_no_inherit.sh

Docs: JSON-POLICY section 6 records the ruling. HYPATIA-BASELINE-FORMAT
tells editors to run ijson-jcs fix after an edit.

Checks:
- apply-baseline.sh gives byte-identical output on the old and new
  files, in advisory and blocking mode.
- exemption ratchet against origin/main: OK, .hypatia-baseline.json
  unchanged at 62.
- Tests pass: exemption-ratchet, apply-baseline,
  hypatia-blocking-gate, check-ijson-jcs, secret-scanner-no-inherit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014h2gFLLQibfB5N5hFz9ZCD
The ijson-jcs scan is report-only. On its own it would let the next jq
edit put the baseline back into an indented layout without failing
anything. The baseline is edited often (#1239 and #1244 last week). The
package.json ruling (LANGUAGE-POLICY 1.4) pairs its conversion with a
job that fails on a forgotten re-canonicalise. This does the same for
the baseline.

New job in ijson-jcs.yml, "Converted JSON stays canonical": runs
check-ijson-jcs.sh --enforce on .hypatia-baseline.json only. The
repo-wide scan stays report-only. The job's checkout and the ijson-jcs
commit are pinned the same as the existing job.

Verified: enforce exits 0 on this branch and 1 on origin/main's copy.
actionlint 1.7.7 is clean. validate-sha-pins, validate-actions-lock,
check-lock-sync, duplicate-keys, permissions and the actions-lock gate
pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014h2gFLLQibfB5N5hFz9ZCD
@hyperpolymath
hyperpolymath marked this pull request as ready for review October 19, 2026 16:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T20:52:09.358511Z f30d35d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d420f60c-3c4a-425c-8900-f8051394b59d
📥 Commits

Reviewing files that changed from the base of the PR and between 6079383 and f30d35d.

📒 Files selected for processing: 4
  • .github/workflows/ijson-jcs.yml
  • .hypatia-baseline.json
  • 3-practice/JSON-POLICY.adoc
  • docs/HYPATIA-BASELINE-FORMAT.adoc

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout: 43
  • GitHub Check: scan / gitleaks
  • GitHub Check: scan / shell-secrets
  • GitHub Check: scan / rust-secrets
  • GitHub Check: governance / Security policy checks
  • GitHub Check: governance / Guix packaging policy (Nix retired)
  • GitHub Check: governance / Actions lockfile verify
  • GitHub Check: Lockfile self-consistency
  • GitHub Check: governance / Code quality + docs
  • GitHub Check: governance / Workflow security linter
  • GitHub Check: governance / Well-Known (RFC 9116 + RSR)
  • GitHub Check: governance / Debt ratchet
  • GitHub Check: governance / Licence consistency
  • GitHub Check: governance / Exemption ratchet
  • GitHub Check: governance / JS runtimes — bun
  • GitHub Check: governance / JS runtimes — deno
  • GitHub Check: governance / Allowlist Preflight
  • GitHub Check: actions.lock is in sync with the workflow YAML
  • GitHub Check: governance / JS runtimes — pnpm
  • GitHub Check: governance / JS runtimes — environment provisions Bun first
  • GitHub Check: governance / Language / package anti-pattern policy
  • GitHub Check: governance / Live Actions policy (credentialed advisory)
  • GitHub Check: governance / Check Workflow Staleness
  • GitHub Check: analyze-js / analyze
  • GitHub Check: governance / Trusted-base reduction policy
  • GitHub Check: governance / UUID v8 conformance
  • GitHub Check: scorecard / Run Scorecard PR
  • GitHub Check: governance / UUID v7 conformance
  • GitHub Check: ci / Detect mix.exs
  • GitHub Check: analyze-actions / analyze
  • GitHub Check: Report non-canonical JSON (report-only)
  • GitHub Check: scan / Hypatia Neurosymbolic Analysis
  • GitHub Check: uses ⊆ actions.lock
  • GitHub Check: Check Documentation Format
  • GitHub Check: K9-SVC contractile validation
  • GitHub Check: Detect proof changes
  • GitHub Check: Verify CLAIMS.a2ml + conformance
  • GitHub Check: Converted JSON stays canonical
  • GitHub Check: AffineScript Verify
  • GitHub Check: Reject non-v8 UUID literals
  • GitHub Check: SPARK Theatre Gate
  • GitHub Check: Scan for hand-authored JavaScript/TypeScript
  • GitHub Check: Repo self-tests
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments: 5
.hypatia-baseline.json: 1

1-1: LGTM!

.github/workflows/ijson-jcs.yml: 2

4-6: LGTM!

34-49: LGTM!

3-practice/JSON-POLICY.adoc: 1

119-123: LGTM!

docs/HYPATIA-BASELINE-FORMAT.adoc: 1

38-43: LGTM!

📝 Summary

Summary by CodeRabbit

  • Documentation

    • Clarified how to format and validate the baseline file after editing.
    • Documented that the baseline must use canonical JSON formatting.
  • Chores

    • Added a check that fails when the baseline file is not canonical.
    • Updated the baseline file’s formatting without changing its entries.

The workflow adds an enforcement job for .hypatia-baseline.json. The baseline is reformatted as a single-line array, and the policy documents describe its canonical format and the procedure to fix it.

Changes: Baseline canonicality

Layer / File(s) Summary
Baseline format and enforcement
.hypatia-baseline.json, .github/workflows/ijson-jcs.yml, 3-practice/JSON-POLICY.adoc, docs/HYPATIA-BASELINE-FORMAT.adoc
The baseline entries and values are retained in a compact, single-line array. The workflow adds an enforcement-mode check for the baseline. The policy documentation describes the canonical format and instructs contributors to run ijson-jcs fix after edits.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to f30d3

The baseline representation is updated and a focused canonicality check is added. No actionable merge risk introduced by this change is established.

Security architecture risk: ⚪ Minimal · up to f30d3

The new check validates formatting without changing the baseline’s entries, granting additional permissions, or modifying deployed configuration. No material security risk introduced or worsened by this PR was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The introduced effect is confined to baseline-format validation and its CI result. The changed job contains no deployment, baseline rewrite, or shared-state update, so interruption or repetition does not introduce a partially applied production configuration transition.

Trust Boundaries and Controls

  • observed — The workflow continues to run on pull requests and pushes to main with contents: read. The new checkout disables credential persistence, and the added job contains no secret references or permission overrides. The inspected change does not introduce a privileged event or expand declared token authority.
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: canonicalising .hypatia-baseline.json as I-JSON and JCS, with CI enforcement.
Description check Passed The description is directly related to the changeset. It explains the canonicalisation, documentation updates, CI enforcement, testing, and known unrelated workflow failure.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (4 skipped: 4 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

DEED–K9 green

🟢 conformant · commit f30d35def8ec · run 39322084367

Category Status Pass Fail Indeterminate N/A Since previous revision
DEED syntax 🟢 conformant 4 0 0 0 ↔ unchanged
K9 contract typecheck 🟢 conformant 1 0 0 0 ↔ unchanged
K9 validator self-test 🟢 conformant 34 0 0 0 ↔ unchanged
K9 positive/negative controls 🟢 conformant 27 0 0 0 ↔ unchanged
K9 live corpus (L0–L2) 🟢 conformant 12 0 0 2 ↔ unchanged
K9 live corpus (L0–L2): 2 finding(s) / scope notes
  • 2-protocols/k9-coordination/examples/minimal.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.
  • coordination.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.

Scope: DEED syntax and K9 contracts L0–L2. L3 signature verification and routed coordination dialects are not certified. Green is limited to this scope. Orange is missing evidence; grey is an explicit scope exclusion. Logs and report.json are in the dated conformance-evidence artifact on the linked run.

hyperpolymath commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner Author

scan / Hypatia Neurosymbolic Analysis and governance / Validate Hypatia Baseline are red, and neither failure is this PR's.

Both gates keep the same two findings and nothing else, on 2b535120 and on the merged head 01f43757:

invalid_actions_lock  .github/workflows/actions.lock  (workflow_audit, workflow_hardening)
reason: {:line, 4, {:unsupported_version, "v0.0.3"}}

#1300 (the Dependabot actions bump) moved actions.lock to lockfile format v0.0.3. The pinned Hypatia scanner only reads v0.0.2.

Why this PR didn't cause it:

  • main fails the same way on every push since chore(deps): bump the actions group with 3 updates #1300. One example is run 39286638118 on 333b06a0: same two findings, same "Gate failed: 2 unfiltered finding(s) at or above 'high'".
  • This PR doesn't touch actions.lock. On this branch's head, the lock validates with the gh-actions-lock version CI pins (v0.2.0): "Immutable direct and transitive lockfile coverage verified".
  • The canonical baseline is read correctly. Validate Hypatia Baseline reports no schema or parse error, and every other finding is still suppressed. The two lock findings are the only ones kept.

No fix exists yet. apply-baseline-test.sh requires that the shipped baseline hold no invalid_actions_lock ack, so this cannot be baselined, and it shouldn't be. The cure is to bump the Hypatia scanner pin in hypatia-scan-reusable.yml to a Hypatia commit that reads lockfile v0.0.3. That is upstream work in hyperpolymath/hypatia and is out of scope here.

I'm not re-running either check. The scanner is pinned and the failure is deterministic, so a re-run would fail the same way. Once a pin bump lands on main, merging main into this branch should clear both.


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 19, 2026 20:46
@sonarqubecloud

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f30d35def8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +35 to +39
# BLOCKING, for converted files only (JSON-POLICY §6). A file listed here was
# canonicalised under an owner ruling and must not drift back to an indented
# layout on its next jq edit. The report-only scan above cannot catch that.
# Fix a failure with `ijson-jcs fix <file>`.
converted-stay-canonical:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route the canonicality check through a required gate

This job can report red but cannot block a merge as claimed: the repository derives required status contexts exclusively from the workflow files listed in config/rulesets/gates.json, and ijson-jcs.yml is not among them. Consequently, a PR that rewrites .hypatia-baseline.json non-canonically can still merge. Put this enforcement in an already-required workflow or add this workflow to the gate configuration and apply the updated ruleset.

Useful? React with 👍 / 👎.

@hyperpolymath
hyperpolymath merged commit c5107fd into main Oct 19, 2026
53 of 55 checks passed
@hyperpolymath
hyperpolymath deleted the claude/gallant-euler-yinsyw branch October 19, 2026 20:54
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.

2 participants