Skip to content

Milestone 4 validation kit and security hardening - #12

Merged
solnikhil merged 3 commits into
mainfrom
feat/m4-kit-and-security-hardening
Aug 4, 2026
Merged

Milestone 4 validation kit and security hardening#12
solnikhil merged 3 commits into
mainfrom
feat/m4-kit-and-security-hardening

Conversation

@solnikhil

@solnikhil solnikhil commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add the Milestone 4 quiet-beta kit under docs/m4/ (publisher guide, outreach, trackers, discovery/comprehension/usage protocols, scorecard).
  • Harden core security paths from the multi-agent code review: DoH body/QNAME/redirect limits, pin write validation + CAS under lock, post-confirm registry recheck, honest di verify vs pin continuity, resolver + DNSSEC (resolver AD) wording, stderr hints.
  • Expand the deterministic suite to 76 tests and fix scope-registry fixtures so project .npmrc is loaded via a package root.
  • Update ROADMAP/README/SECURITY and add research notes (docs/research/, feature research backlog) that support the validation-first plan.

Security / CLI highlights

  • src/doh.ts: max body/answer/data sizes, redirect: error, wrong-name TXT → malformed
  • src/pin.ts: validate on write; savePin returns result and refuses concurrent pin divergence
  • src/install.ts: assertEffectiveRegistryUnchanged before spawn
  • src/cli.ts: pin-aware verify, conflict listing, CAS save after install, clearer --yes / DNSSEC copy

Test plan

  • npm test (76 passed, 0 failed) on Windows / Node 22+
  • CI matrix green on the PR (ubuntu/macos/windows × Node 22.14 / 24.x)
  • Spot-check: di verify zuraai.xyz still resolves the reference mapping
  • Confirm docs/m4 links from README and ROADMAP §7 render on GitHub

Out of scope

  • Live E2E bound to publish workflow
  • Bootstrap publish workflow retirement
  • Windows post-publication human verification (ROADMAP §4 open gate)
  • Growth bets (di setup, resolve --json, multi-PM)

Summary by CodeRabbit

  • New Features

    • Improved installation and verification safeguards, including registry-change detection and safer trust-pin updates.
    • Added clearer resolution details, DNSSEC status, provider information, and actionable installation errors.
    • Strengthened DNS response validation and protection against malformed, oversized, redirected, or conflicting responses.
  • Bug Fixes

    • Refined handling of concurrent trust updates, scoped registries, and package installation failures.
  • Documentation

    • Expanded release, security, platform, roadmap, research, publisher, and Milestone 4 validation guidance.
  • Tests

    • Added coverage for trust pins, DNS validation, registry consistency, and concurrent updates.

Copilot AI lite review requested due to automatic review settings August 4, 2026 16:13
Ship the quiet-beta materials under docs/m4, harden DoH/pin/install/CLI against review findings, expand the deterministic suite to 76 cases, and record research notes that back the roadmap.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@solnikhil, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 78b2d9b6-9a66-4d42-be43-4972984d2b2f

📥 Commits

Reviewing files that changed from the base of the PR and between 9566b75 and 107ca4e.

📒 Files selected for processing (31)
  • ROADMAP.md
  • docs/FEATURE-CANDIDATES.md
  • docs/FEATURE-RESEARCH-REPORT.md
  • docs/HISTORY-AUDIT.md
  • docs/RESEARCH-BACKLOG.md
  • docs/m4/COMPREHENSION.md
  • docs/m4/CONTACT-TRACKER.md
  • docs/m4/DISCOVERY-PROTOCOL.md
  • docs/m4/PUBLISHER-GUIDE.md
  • docs/m4/RESULTS.md
  • docs/m4/RUNBOOK.md
  • docs/m4/USAGE-DIARY.md
  • docs/research/FINDINGS-POSITIONING.md
  • docs/research/FINDINGS-WINDOWS-AND-SCRIPTS.md
  • package.json
  • scripts/test-exhaustive.ts
  • scripts/test.ts
  • scripts/tests/args.test.ts
  • scripts/tests/cli.test.ts
  • scripts/tests/doh.test.ts
  • scripts/tests/harness.ts
  • scripts/tests/install.test.ts
  • scripts/tests/pin.test.ts
  • scripts/tests/record.test.ts
  • scripts/tests/terminal.test.ts
  • scripts/tests/ui.test.ts
  • scripts/tests/validate.test.ts
  • src/cli.ts
  • src/doh.ts
  • src/install.ts
  • src/pin.ts
📝 Walkthrough

Walkthrough

The PR updates product, security, release, roadmap, research, and Milestone 4 documentation. It also hardens DoH validation, registry checks, trust-pin persistence, installation flow, verification output, and related tests.

Changes

Product and validation

Layer / File(s) Summary
Product, release, and security documentation
CHANGELOG.md, README.md, ROADMAP.md, SECURITY.md, docs/HISTORY-AUDIT.md, docs/RELEASE-CANDIDATE.md, docs/RELEASE.md, package.json
Documentation clarifies product boundaries, release controls, platform status, security claims, and package keywords.
Research inventory and feature strategy
docs/FEATURE-CANDIDATES.md, docs/FEATURE-RESEARCH-REPORT.md, docs/RESEARCH-BACKLOG.md, docs/research/FINDINGS-POSITIONING.md
Feature candidates, research results, measurements, priorities, and continue-or-pivot decisions are documented.
Milestone 4 validation kit
docs/m4/*
The kit adds publisher outreach, setup guidance, discovery testing, usage tracking, comprehension testing, runbook procedures, and gate scorecards.
Technical research findings
docs/research/*
Research documents record DoH, non-TTY, pin, registry, Windows, script, and deferred security decisions.

Implementation hardening

Layer / File(s) Summary
Resolver, registry, and pin hardening
src/cli.ts, src/doh.ts, src/install.ts, src/pin.ts
The CLI reports resolver state, rechecks registries, verifies mappings, and uses compare-and-swap pin persistence. DoH responses receive owner-name and size validation.
Hardening validation tests
scripts/test.ts
Tests cover pin writes, concurrent writers, registry resolution, DNS answer ownership, and oversized DoH responses.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant RegistryConfig
  participant Npm
  participant PinStore
  CLI->>RegistryConfig: Recheck effective registry
  RegistryConfig-->>CLI: Return current registry
  CLI->>Npm: Install with validated registry
  Npm-->>CLI: Return installation result
  CLI->>PinStore: Save pin with expected existing identity
  PinStore-->>CLI: Return success or divergence
Loading

Possibly related PRs

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.74% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the Milestone 4 validation materials and security hardening that define the main changes.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/m4-kit-and-security-hardening

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.

…opy.

Compare registries after host/path normalization, treat concurrent same-identity first-use pin writes as success, align ROADMAP DNSSEC wording with the CLI, warn when verify cannot re-read npm registry config, and wire exhaustive unit coverage into npm test.

@coderabbitai coderabbitai 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.

Actionable comments posted: 17

🧹 Nitpick comments (2)
docs/HISTORY-AUDIT.md (1)

9-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use an H2 heading for Checks performed.

The document title is an H1. ### Checks performed skips the H2 level. Change it to ## Checks performed to keep the Markdown hierarchy valid and satisfy MD001.

Proposed fix
-### Checks performed
+## Checks performed
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/HISTORY-AUDIT.md` at line 9, Change the “Checks performed” heading under
the document’s H1 title from an H3 to an H2 by using two leading hash
characters, preserving the heading text.

Source: Linters/SAST tools

docs/m4/DISCOVERY-PROTOCOL.md (1)

600-605: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy lift

Use participant-aware uncertainty estimates.

Wilson and exact-binomial intervals treat the 18 trials as independent. This study assigns repeated trials to only six participants. If an interval is reported, use a participant-aware paired or clustered method. Otherwise label the percentages as descriptive.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/m4/DISCOVERY-PROTOCOL.md` around lines 600 - 605, Update the
“Statistical honesty” guidance to require participant-aware paired or clustered
uncertainty estimates, since the 18 trials are repeated across six participants
rather than independent. If no such interval is reported, explicitly label the
percentages as descriptive, and avoid presenting Wilson or exact-binomial
intervals as appropriate standalone estimates.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/FEATURE-CANDIDATES.md`:
- Around line 855-863: Update the weekly pivot triggers to include Gate 4
correctness alongside publisher and comprehension in both
docs/FEATURE-CANDIDATES.md lines 855-863 and docs/FEATURE-RESEARCH-REPORT.md
line 791; ensure the pivot-watch wording matches the hard-stop decision rule
while preserving the existing thresholds and actions.

In `@docs/m4/COMPREHENSION.md`:
- Around line 149-166: Clarify the decision status for passes with 5–9
completers in the Gate-level and Worked examples sections. Align the 5/5 and 4/5
examples with the document’s provisional-under-10 rule, explicitly
distinguishing a provisional pass from an actionable gate pass and applying that
rule consistently before recording results.

In `@docs/m4/CONTACT-TRACKER.md`:
- Around line 32-48: Update the Tracker table and its usage guidance to make
Gate 1 eligibility explicit and auditable: add structured fields for qualified
status, external status, exclusion status, qualification evidence, and
verification date, and define how they must be populated before counting a row
in gate totals. Do not rely on free-form Notes for these eligibility decisions,
and preserve the control-row exclusion.

In `@docs/m4/DISCOVERY-PROTOCOL.md`:
- Around line 40-48: Update the primary metrics and Gate 4 criteria in the
discovery protocol to separate live CLI validation from simulated stimulus-card
scoring. Require a minimum number of live `di verify` trials for Gate 4, or
define simulated results as a separate materials-validation gate, rather than
aggregating both trial types.
- Around line 132-140: Update the consent brief in the introductory block to
disclose all retained fields: participant_id, task_id, condition,
package_answer, abandoned, notes, and timestamp. Clarify whether participant_id
is pseudonymous, and add the study’s data retention period and access terms
before the consent statement.

In `@docs/m4/PUBLISHER-GUIDE.md`:
- Around line 22-30: Update the prerequisites wording in PUBLISHER-GUIDE.md to
clarify that Node.js and npm are unnecessary for creating the DNS TXT record,
but required for installing or running the domaininstall CLI, including the
later di verification and installation steps.

In `@docs/m4/RESULTS.md`:
- Line 34: Update the “Overall M4 status” scorecard in RESULTS.md to select “Not
started” initially instead of “In progress”; leave the status transition to “In
progress” for the documented Day 1 pre-flight process in RUNBOOK.md.
- Around line 153-173: The Final decision checklist conflicts with the Hold /
incomplete option by requiring every gate to be Pass, Fail, or waived. Update
the completion criteria around the “Final decision” section to allow Incomplete
for non-hard-stop gates and permit “Hold / incomplete” without requiring a
waiver, while preserving the requirement that hard-stop gates cannot be waived
to continue.

In `@docs/m4/RUNBOOK.md`:
- Line 30: Update the roadmap link in the runbook so its fragment matches the
renderer’s generated heading slug without relying on § characters, or add and
reference an explicit stable anchor for the “Updating the roadmap §2 and §7”
heading.
- Around line 62-64: Update the published tool installation check in the runbook
to use an explicit domaininstall version for both global npm installation and
npx execution, replacing unpinned commands with the tested @<version> form.
Record the same tested version in the beta scorecard.

In `@docs/m4/USAGE-DIARY.md`:
- Around line 158-168: Update the anecdote-counting rules in the “Allowed with
care” and “Do not” sections to deduplicate the same alleged_user across
publishers and diary entries using the user identity and date. Require that key
for anecdotal claims, or count an anecdote only when it cannot match another
anecdote or diary entry, while preserving the existing one-user/one-use limits.

In `@docs/RESEARCH-BACKLOG.md`:
- Line 125: Restore the backlog item headings in docs/RESEARCH-BACKLOG.md by
separating or removing each orphan Status row that is merged with a following
#### heading. Ensure every referenced backlog item has a valid Markdown heading
and one authoritative status field, without leaving standalone table rows
lacking headers or separators.
- Around line 66-89: Synchronize each detailed research item’s Status field with
the priority-stack statuses, including RB-DOH, RB-PIN, RB-TOCTOU, RB-PURL, and
all other referenced entries. Update the closing statement near the end of the
document to state that only open or partial research items remain, rather than
claiming all items are open.

In `@docs/research/FINDINGS-POSITIONING.md`:
- Around line 114-134: Update the “Today”/“Current” DNSSEC rows in the findings
section to use the shipped labels “DNSSEC: AD” for authenticated responses and
“DNSSEC: no AD” for unauthenticated responses. Adjust surrounding wording as
needed, and remove or mark the recommendation as already implemented rather than
proposing another label change.

In `@docs/research/FINDINGS-WINDOWS-AND-SCRIPTS.md`:
- Line 151: Update the table cell in FINDINGS-WINDOWS-AND-SCRIPTS.md containing
“O_RDONLY | undefined” so the pipe is escaped or the expression is rewritten
without a table delimiter, preserving the full no-follow explanation in rendered
Markdown.

In `@scripts/test.ts`:
- Around line 663-674: Isolate the registry recheck in the test around
assertEffectiveRegistryUnchanged by creating a temporary package root containing
a project .npmrc that sets https://registry.npmjs.org/. Pass that temporary
directory as the third argument for both the stable-registry and drift checks,
avoiding reliance on process.cwd() or user/CI npm configuration.

In `@src/doh.ts`:
- Around line 190-199: Update the response-body handling in the DoH request flow
around response.text() to read from response.body as a stream, count each
Uint8Array chunk by byteLength against MAX_DOH_BODY_BYTES, and cancel the reader
when the cap is reached. Decode the accumulated bytes consistently before
parsing, and preserve malformed(provider) handling for unavailable bodies or
read/decode failures.

---

Nitpick comments:
In `@docs/HISTORY-AUDIT.md`:
- Line 9: Change the “Checks performed” heading under the document’s H1 title
from an H3 to an H2 by using two leading hash characters, preserving the heading
text.

In `@docs/m4/DISCOVERY-PROTOCOL.md`:
- Around line 600-605: Update the “Statistical honesty” guidance to require
participant-aware paired or clustered uncertainty estimates, since the 18 trials
are repeated across six participants rather than independent. If no such
interval is reported, explicitly label the percentages as descriptive, and avoid
presenting Wilson or exact-binomial intervals as appropriate standalone
estimates.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bef6b481-64de-4d64-ba4b-ff707c385f2c

📥 Commits

Reviewing files that changed from the base of the PR and between f934e5f and 9566b75.

📒 Files selected for processing (36)
  • CHANGELOG.md
  • README.md
  • ROADMAP.md
  • SECURITY.md
  • docs/FEATURE-CANDIDATES.md
  • docs/FEATURE-RESEARCH-REPORT.md
  • docs/HISTORY-AUDIT.md
  • docs/RELEASE-CANDIDATE.md
  • docs/RELEASE.md
  • docs/RESEARCH-BACKLOG.md
  • docs/m4/COMPREHENSION.md
  • docs/m4/CONTACT-TRACKER.md
  • docs/m4/DISCOVERY-PROTOCOL.md
  • docs/m4/OUTREACH.md
  • docs/m4/PLACEMENT-SNIPPETS.md
  • docs/m4/PROSPECT-CANDIDATES.md
  • docs/m4/PUBLISHER-GUIDE.md
  • docs/m4/README.md
  • docs/m4/RESULTS.md
  • docs/m4/RUNBOOK.md
  • docs/m4/USAGE-DIARY.md
  • docs/research/FINDINGS-DOH.md
  • docs/research/FINDINGS-M4-DRYRUN.md
  • docs/research/FINDINGS-NONTTY.md
  • docs/research/FINDINGS-PIN-AND-TOCTOU.md
  • docs/research/FINDINGS-POSITIONING.md
  • docs/research/FINDINGS-RDAP-MAXAGE-FIRSTUSE.md
  • docs/research/FINDINGS-SCOPE-AND-PURL.md
  • docs/research/FINDINGS-WINDOWS-AND-SCRIPTS.md
  • docs/research/README.md
  • package.json
  • scripts/test.ts
  • src/cli.ts
  • src/doh.ts
  • src/install.ts
  • src/pin.ts

Comment thread docs/FEATURE-CANDIDATES.md
Comment thread docs/m4/COMPREHENSION.md Outdated
Comment thread docs/m4/CONTACT-TRACKER.md Outdated
Comment thread docs/m4/DISCOVERY-PROTOCOL.md
Comment thread docs/m4/DISCOVERY-PROTOCOL.md
Comment thread docs/RESEARCH-BACKLOG.md Outdated
Comment thread docs/research/FINDINGS-POSITIONING.md Outdated
Comment thread docs/research/FINDINGS-WINDOWS-AND-SCRIPTS.md Outdated
Comment thread scripts/test.ts Outdated
Comment thread src/doh.ts Outdated
@solnikhil
solnikhil merged commit 58c7e97 into main Aug 4, 2026
7 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.

2 participants