Skip to content

Trust anchor: content hashes in the API, risky-call lint, CODEOWNERS, security review (ADR-010 step 1) - #8

Merged
galib9690 merged 4 commits into
mainfrom
feat/trust-anchor
Nov 30, 2026
Merged

galib9690 merged 4 commits into
mainfrom
feat/trust-anchor

Conversation

@galib9690

Copy link
Copy Markdown
Member

ADR-010 Amendment 1, step 1 ("Anchor"): make the curated marketplace a real trust anchor for running lesson code in AI-Hydro Studio. Owner decisions 2026-11-30.

What

  • Content hashes in the API: every entry in api/modules.json / api/courses.json gains files: [{path, sha256}] (exact repo bytes, sorted by path) and content_sha256 (sha256 of the sha256sum-format listing). Modules: their module.html; the course: course.json + every member module.html — exactly what the extension's installers fetch. Schema in api/README.md, which also states the limit: the bot re-hashes whatever is on main, so hashes attest index↔file consistency, not review.
  • CI drift gate: build_api.py --check (existing step) now covers the hashes; a module changed without regenerating the API fails CI (mutation-tested).
  • build-api.yml: pull --rebase + bounded retry before the bot push, so a concurrent merge cannot leave a stale index.
  • Course member downloadUrl required (validate_manifests.py), so what is hashed is what is fetched.
  • Risky-call lint for reviewers (scripts/lint_cell_risk.py, non-blocking in checks.yml, ::warning annotations): subprocess / os.system / os.kill / asyncio subprocess / network modules (incl. NWIS-style client packages) / shutil.rmtree / eval-exec-compile / env reads / writes outside the working directory; resolves import aliases. Not a sandbox; Python cells only (page JS is covered by check_csp); absolute-path reads not detected. Today: 1 finding, the documented optional NWIS cell in real-streamflow-data.
  • .github/CODEOWNERS (* @galib9690) — takes effect once the required-review ruleset rule is enabled (pending owner decision; ruleset 28405855 already blocks force-push and deletion of main).
  • CONTRIBUTING "Security review": what reviewers check on cell code; trustLevel is a publisher label, not a scientific review ("Draft — AI-assisted review only"); Studio-side hash verification and re-consent are designed (step 2), not yet released.
  • CHANGELOG, PROGRESS.

Verification

pytest tests 373 passed, 3 skipped (incl. new tests/test_trust_anchor.py); node --test tests/js/*.test.js 164 pass; build_modules, render_static_outputs, gen_docs, build_api --check, validate_manifests, check_csp all pass. Separate-context review PASS-WITH-FIXES, fixes in b947545. Workflow YAML changes not yet run on Actions.

Nothing consumes the new fields until the extension's step 2 lands (in progress).

🤖 Generated with Claude Code

mohdgalib and others added 2 commits November 30, 2026 21:34
…EOWNERS, security review

ADR-010 Amendment 1, step 1. api/modules.json and api/courses.json carry files[{path,sha256}]
and content_sha256 for everything Studio downloads. scripts/lint_cell_risk.py is a non-blocking
reviewer aid (not a sandbox). CONTRIBUTING gains a Security review section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wnloadUrl, lint aliases

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mohdgalib and others added 2 commits November 30, 2026 22:56
…resh via reviewed branch

Lets the main ruleset require review with no bot bypass (deploy keys are disabled
for the organisation; GitHub refused a GitHub Actions bypass). ADR-010 Amendment 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@galib9690

Copy link
Copy Markdown
Member Author

Two more commits (owner approved the review rule 2026-11-30): build-api.yml no longer commits to main. On push it only verifies the committed API (build_api.py --check); the cosmetic reaction refresh runs on manual dispatch and pushes a bot/api-refresh-* branch for a normal reviewed PR. Reason: deploy keys are disabled for the AI-Hydro organisation and GitHub refused a GitHub Actions bypass, so this is the way to require review on main with no bot bypass. pytest tests 373 passed, 3 skipped; build_api.py --check up to date. After this merges I enable the required-review rule on the main ruleset.

🤖 Generated with Claude Code

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