Skip to content

chore: adopt fork-maintenance harness for fork maintenance - #5

Closed
malarinv wants to merge 1 commit into
upstream-mainfrom
chore/forklift-harness
Closed

malarinv wants to merge 1 commit into
upstream-mainfrom
chore/forklift-harness

Conversation

@malarinv

@malarinv malarinv commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

The fork-maintenance tooling that the registry commits reference. Independent of the two feature PRs (#1 Rego, #2 GitOps) and of #4 (release pipeline), so each can be reviewed and merged on its own.

What lands: the maintenance registry + docs (the fork's memory of every divergence, each with a written reason), the generated install artifacts (init/maintain/doctor skills and Cursor rules), and the AGENT.md section that tells an agent to consult them.

Why separate from #3/#4: #3 only renamed package.json, and the registry tracks those release files as fork-owned divergences too — but the harness itself is tooling, not release behavior. Reviewing it next to publisher rewrites hides the fact that it carries no runtime change. .cursor/rules/codegraph.mdc stays upstream's (it exists upstream).

No product behavior — coverage_exempt bookkeeping only. This is what makes a later git rebase upstream/main resolve grammars.ts and release.yml conflicts by recorded policy instead of by guesswork.

Registers the fork's divergence memory so later upstream rebases resolve conflicts
by policy rather than by luck: the .forklift registry and docs, the install
skills (forklift-init/-maintain/-doctor) and their Cursor rules, and the
AGENT.md section pointing agents at them.

No product behavior; all bookkeeping is forklift-generated.
@malarinv malarinv closed this Nov 7, 2026
@malarinv
malarinv deleted the chore/forklift-harness branch November 7, 2026 17:37
@malarinv malarinv changed the title chore(forklift): adopt forklift harness for fork maintenance chore: adopt fork-maintenance harness for fork maintenance Nov 7, 2026
malarinv pushed a commit that referenced this pull request Nov 11, 2026
…ered verbatim linking, pass −22% at kernel scale (colbymchenry#1364)

Task #5 step 1 (plan §7a.8/§7a.9). The C/C++ function-pointer dispatch
synthesizer swept every file's text four times (typedefs, registrations,
propagation, dispatch); at kernel scale the all-or-nothing source cache
declines, so that was 4.4 read+strips per file — 78s of the ~230s pass.

Now ONE extraction sweep reads+strips each file once and collects typedef
names, struct-node field declarations (structurally parsed, fn-pointer
classification deferred until the typedef sets are complete), resolved
includes, an alias-shaped-macro name set, and per-file survival filters
(init type tokens, array element types, inline-struct summaries,
field-assign pairs, dispatch fields/array names — interned, a few MB on
linux). The linking stages then replay the ORIGINAL pass bodies verbatim:
struct layouts register in kind-scan order (same-name precedence is
order-sensitive), and registration/propagation/dispatch run only for
files their filter proves can have side effects, lazily re-stripping just
those. Filters only over-approximate (full-file no-skip scans ⊇ the real
passes' jump-cursor scans), and a filtered-out file is one where every
match fails the pass's own gates before any side effect — parity by
construction. Macro tables stay lazy: a sizing probe found 6.1M #define
lines on linux (amdgpu register headers), ruling out retention.

Measured (8c cg1212, quiet host, fresh kernel init): cFnPtr pass 230s →
179s (−22%); strips 283.5k → 132.4k (4.44 → 2.08/file, 78 → 46.6s);
dispatch stage 95 → 18.5s; callback-synthesis phase 250 → 199.9s.
Standalone probe on the live DB: 139 → 122s.

Byte-parity gates, all green: probe-hash identical on the live kernel DB
(279,335 edge rows both builds); git/redis/vim/SameBoy full dumps
byte-identical old-vs-new (macro tables, commands.def, #ifdef
include-units, inline structs, bare arrays exercised); kernel-parity
0-diffs on git/redis/fmt/protobuf, deferral unchanged; linux counts
exact 2,049,153/6,413,518 and dump sha 6dd1185b… reproduced
(10,446,478 lines); full suite green ×2 (152 files / 2563 tests).

Step 2 (native per-file extractor) now has its boundary: the extraction
sweep, raw text in → records out.

Co-authored-by: Claude Fable 5 <[email protected]>
malarinv pushed a commit that referenced this pull request Nov 11, 2026
…across the arc (§7a.10) (colbymchenry#1365)

Task #5 step 2. The fuse-then-link refactor (colbymchenry#1364) left the extraction
sweep as a clean per-file boundary: raw text in → collected facts out.
This ports that sweep to the native kernel: `cfnptr_scan_files`
(codegraph-kernel/src/cfnptr.rs) strips and scans a batch of 16 files
per NAPI call, and the TS side only reads files, ships batches, interns
the returned facts, and resolves include paths. The JS sweep remains as
the fallback (no binary, feature detection against older binaries,
CODEGRAPH_KERNEL=0, or CODEGRAPH_KERNEL_CFNPTR=0).

Parity discipline: the JS regexes are the spec, so the scanners are
hand-rolled byte machines reproducing that engine — ASCII \w/\b next to
UNICODE \s (NBSP/U+2000-200A/FEFF decoded from UTF-8), alternation
order, lastIndex resume, and the observable backtracking dimensions
(INIT/ARRAY modifier and struct/star/bracket optionals, DISPATCH's
greedy segment loop); greedy shortcuts only where backtracking provably
can't rescue a match. The native stripper blanks per UTF-16 code unit,
so its output is string-identical to the TS stripper — pinned by a new
kernel arm on the strip differential oracle (fixtures + 500 seeded
random cases).

Gates, all green: new differential suite (adversarial fixture project —
CRLF, NBSP, continuations, decoy strings, unterminated comments,
backtracking shapes — indexed native-vs-JS: identical edge streams,
plus a record-level scanner check); repo differential on
git/redis/vim/SameBoy (identical, 705/852/433/180 edges); probe-hash on
the live linux kernel DB reproduced f6e1713d… (279,335 rows); linux
init counts exact 2,049,153/6,413,518; dump sha 6dd1185b… reproduced
(10,446,478 lines); full suite green ×2 (153 files / 2588 tests).

Measured (8c cg1212, quiet host): cFnPtr sub A=47.9s B=1.1 C=40.9
D=24.1 E=36.8 = 150.9s vs step 1's 179s and the pre-arc 230s (−34%
cumulative); the sweep itself halved (94.5→47.9s, JS strips
132.4k→68.9k). callback-synthesis phase 199.9→171.1s. E's attributed
wall grew from overlap shift under parallel synthesis; the phase total
is the honest number. Full record: plan §7a.10.

Co-authored-by: Claude Fable 5 <[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