Skip to content

M1 retrospective: patch the kit with 4 lessons from the nmap port - #11

Merged
kj299 merged 1 commit into
masterfrom
claude/m1-retrospective
Jul 10, 2026
Merged

kj299 merged 1 commit into
masterfrom
claude/m1-retrospective

Conversation

@kj299

@kj299 kj299 commented Jul 10, 2026

Copy link
Copy Markdown
Owner

The kit's non-negotiable compounding step for Milestone 1 — run every harness against the real target, then patch PLAYBOOK.md/harnesses and append LESSONS.md. Kit changes only; no nmap-rs/ or C source touched. make -C porting-kit check-kit green (all harness self-tests + skills integrity).

Step 0 — harnesses run against real nmap (what each found)

The four lessons

# Lesson Kit patch
006 A scanner reading only .c/.h reports a C++ codebase as "0 flaws" scan_c_flaws.py C++ extensions + self-test; Phase 0 note
007 A case-granular differential can't judge a port that renders a subset canonical-projection pattern; Phase 4 gate 2
008 Miri can't run real I/O — split the pure decision from the syscall Phase 4 gate 4
009 The six-gate model assumes every module has a fuzzable input edge fuzz gate threat-model-scoped + seeds/corpus separation; gen_fuzz_target.sh, Phase 4 gate 3

Meta: 3 of 4 (#6/#7/#8) are the same shape as winlsof's #2–#4 — a control that inspects less than its green checkmark implies. The standing defense (retrospective step 0: run the harnesses against the real target and eyeball what they actually inspected) caught #6 and surfaced #7/#8. The one thing the kit still couldn't force: the insight that the differential needed a semantic projection — same "kit buys time, not the design" limit as #1.

Files

  • porting-kit/LESSONS.md — entries 006–009 + meta
  • porting-kit/PLAYBOOK.md — Phase 0 + Phase 4 gates 2/3/4
  • porting-kit/harnesses/c-flaw-scan/scan_c_flaws.py — C++-coverage self-test
  • porting-kit/harnesses/fuzz/gen_fuzz_target.sh — seeds/corpus + scoping guidance

🤖 Generated with Claude Code

https://claude.ai/code/session_01JfEzHqD7a7TKDuUs5GwZ2w


Generated by Claude Code

The compounding step for Milestone 1 — patch PLAYBOOK/harnesses and append
LESSONS.md with what the nmap MVP taught the kit. Each edit names the failure it
prevents next time.

LESSONS #6 — scan_c_flaws read only .c/.h and reported nmap's ~9.4k LOC of C++
(.cc) as "0 flaws". Extension set widened to cover C++ (fix already in tree from
PR #2); now pinned with a self-test that iter_c_files yields .cc/.cpp/.hpp and
ignores non-source. Phase 0: confirm the scanner reads the target's languages
before believing a low count.

LESSONS #7 — diff_run.py is case-granular, so an MVP that intentionally renders a
subset of C output can't be diffed raw (every case diverges) or ledgered (the
whole case goes blind). Documented the canonical-projection pattern: wrap both
sides in a filter that emits only the semantic result, canonicalizing both
representations so real regressions still break the match. Phase 4 gate 2.

LESSONS #8 — Miri can't execute real I/O (tokio connect aborts under Miri).
Split the pure decision (verdict) from the syscall and cfg(miri)-ignore the I/O
tests, so "Miri can't run this" never becomes "no Miri coverage." Phase 4 gate 4.

LESSONS #9 — the linear six-gate model implies every module needs a fuzz tick,
but fuzzing is threat-model-scoped (parsers, not renderers/models). And
`cargo fuzz run <t> seeds/<t>` writes discovered inputs back into the seeds dir.
gen_fuzz_target.sh guidance now shows corpus/<t> seeds/<t> (writable, read-only)
and scopes the gate. Phase 4 gate 3.

Meta: 3 of 4 are the same shape as winlsof #2-#4 — a control that inspects less
than its green checkmark implies; the defense (retrospective step 0: run every
harness against the real target and eyeball what it inspected) held again.

check-kit: all harness self-tests + skills integrity green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JfEzHqD7a7TKDuUs5GwZ2w
@kj299
kj299 marked this pull request as ready for review July 10, 2026 08:24
@kj299
kj299 merged commit 1de5cd9 into master Jul 10, 2026
12 checks passed
kj299 added a commit that referenced this pull request Jul 18, 2026
* M2 retrospective: patch the kit with 2 lessons from the async-engine port

The compounding step for Milestone 2 — ran every harness against real nmap
(0 unsafe; 8/8 differential MATCH incl. multi-host + rate cases), then patched
the playbook/harnesses and appended LESSONS.md.

LESSONS #10 — ThreadSanitizer is unsound as a gate over an async runtime. CI's
tsan job went red while every test passed: TSan flagged tokio's own work-stealing
scheduler (a false positive in the runtime's atomics), and because app code runs
inside the runtime, suppressions can't separate a runtime false-positive from a
real app race. Guidance added to PLAYBOOK Phase 4 gate 4 + run_sanitizers.sh
(header caveat + a stderr warning on the tsan path): for async concurrency prove
race-freedom structurally (no shared mutable state + Send/Sync on spawn) plus Miri
on the pure logic, and keep a multi-thread liveness test; reserve TSan for OS
threads over genuinely shared state.

LESSONS #11 — a differential must reject a non-file "binary". Passing a directory
as --rust didn't error (a dir has the +x bit, so -x/os.access pass), reached exec,
and surfaced as a confusing parse-error two layers downstream. diff_run.py gained
require_binary() (regular-file + executable, called before any case) and run_one
now catches IsADirectoryError/PermissionError; pinned with self-tests.

Also recorded two positive validations (no change needed): the spike-the-scary-
module habit graduated the congestion math straight into the module with no pivot,
and the pure/impure split scaled to the whole engine — which is exactly why M2
stayed at 0 unsafe and made #10's structural-race-freedom argument possible.

check-kit: all harness self-tests + skills integrity green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JfEzHqD7a7TKDuUs5GwZ2w

* M2 close-out: mark milestones 1 & 2 DONE, set M3 current in PLAN

Status-tracker bookkeeping now that the M2 async engine + retrospective are
merged. M1 and M2 rows flip to DONE; the "we are here" note summarizes the shipped
ultra_scan engine (0 unsafe, 8/8 differential) and points at Milestone 3 (-sV
service/version detection) starting at Phase 0, with the regex-fidelity decision
flagged.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JfEzHqD7a7TKDuUs5GwZ2w

---------

Co-authored-by: Claude <[email protected]>
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