Skip to content

feat(release): publish fork releases to GitHub Packages - #4

Open
malarinv wants to merge 8 commits into
upstream-mainfrom
release/github-packages
Open

malarinv wants to merge 8 commits into
upstream-mainfrom
release/github-packages

Conversation

@malarinv

@malarinv malarinv commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Fork release pipeline publishing under the malarinv owner on GitHub Packages.

Supersedes #3 (which only renamed package.json, while the actual mechanism needed lives here).

Publishing — pack-npm.sh derives scope + repository URL from GITHUB_REPOSITORY; release.yml gains packages: write, a registry-url-configured setup-node and NODE_AUTH_TOKEN: github.token, drops the OIDC --provenance step and the npmjs-only npmmirror nudge, and uses the default token for the CHANGELOG-promote push (the fork has no RELEASE_PAT and no branch rulesets).

Launcher — npm-shim.js/npm-sdk.js resolve the per-platform optionalDependency from the installed main package's own name, so an install from a fork scope finds its bundle instead of asking upstream's for it (this was a live bug: 1.7.0 published but every command 404'd).

Release-body cap — --max-chars 124000 trims release notes at GitHub's 125,000-char limit; byte-identical output without the flag.

Version 1.6.2 → 1.7.1, ui/package.json synced, plus a fork-scope regression test in __tests__/npm-shim.test.ts.

Verified by two full release runs and an end-to-end install from the registry (init → index → explore).

malarbase and others added 8 commits November 2, 2026 23:50
…s, calls)

Rego was previously skipped entirely: `.rego` was not in EXTENSION_MAP, so
security-pipeline's 10 policy files and consensus' 18 indexed to 0 nodes and
0 edges — a policy change had no blast radius at all.

Add `rego` as a tree-sitter language backed by the vendored
tree-sitter-rego wasm (v1.0.0, master@da2a1f6; ABI 15, verified with
scripts/add-lang/check-grammar.mjs — 20/20 clean parses beside the other 29
vendored grammars, 1 MiB file in ~650 ms):

- rule heads (value / set / object / function shapes) become `function`
  nodes, so `codegraph query` and `impact` see a policy's rules
- `default <name>` heads keep their own node — the fallback and the rule
  that overrides it are different things to change
- rule→rule calls become resolvable `calls` edges: `impact is_authorized_subdomain`
  now reports the `deny` rules that call it
- `data.` / `input.` paths become `references`, so a reader sees what a
  policy reads
- packages and imports (including `import data.x as y`) become import nodes

Tested in __tests__/rego-policy-calls.test.ts (8 cases): registration,
per-rule nodes, default-head separation, unresolved call/reference emission,
and a resolved rule→rule `calls` edge through a full index.
…ckages

The fork's package name must match the publishing account, so it becomes
@malarinv/codegraph, with repository/homepage pointing at this fork and a
publishConfig.registry of https://npm.pkg.github.com so a later publish
targets GitHub Packages without an explicit --registry.

Published @malarinv/[email protected] to GitHub Packages (1345 files, 9.9 MB)
and verified the installed artifact: the Rego wasm and extractor ship inside
the tarball, and indexing security-pipeline from the GPR-installed copy
yields 397 nodes / 536 edges with a live rule lookup.

Install from this registry needs a scoped-registry config, since GitHub
Packages serves only packages published to it while the dependencies still
resolve from npmjs:

  npm config set @malarinv:registry https://npm.pkg.github.com
  npm config set //npm.pkg.github.com/:_authToken <GITHUB_TOKEN>
  npm i -g @malarinv/codegraph
Kubernetes, Flux, Crossplane and Backstage catalog manifests were invisible
under the YAML file-level extractor. The gitops framework resolver turns each
apiVersion+kind document into a struct node (Kind/name), emits reference edges
for the pointer keys (sourceRef, dependsOn, path, resources), and gives flat
data files a constant node when their basename reaches the shape Rego reads
(data.<basename>).

Detection is per-repo but classification is per-file: a clusters/ tree or any
scanned manifest turns the resolver on; a concrete file only becomes a node
when it carries an apiVersion+kind, and a data file only when its basename
carries a word separator or a digit (consensus_bounds, policy_limits2) -
kustomization.yaml, mkdocs.yml and dash-named config emit nothing.

The detection predicate no longer requires a Flux or Crossplane group:
security-pipeline is a Rego policy repo whose only manifest is a Backstage
catalog-info.yaml, so its consensus_bounds data file and the policies
reading it stayed unlinked. EXTRACTION_VERSION bumps 28 -> 29 so existing
indexes take the re-index prompt.

Tested in __tests__/gitops-yaml.test.ts (18 cases) and live on snowbud,
whiteblossom-apps and security-pipeline indexes.
The fork publishes under the malarinv owner instead of npmjs.com: pack-npm.sh
derives the scope and repository URL from GITHUB_REPOSITORY, release.yml
authenticates with GITHUB_TOKEN (packages: write) against
npm.pkg.github.com, drops --provenance/OIDC and the npmmirror nudge, and uses
the default token for the CHANGELOG-promote push (the fork has no rulesets).

Version 1.6.2 -> 1.7.0 (new Rego indexing + GitOps YAML manifests);
ui/package.json follows via scripts/sync-ui-version.mjs. Maintenance registry
registers both release files as fork-owned divergences.
[skip ci] Auto-generated by Release workflow.
The 1.6.2 -> 1.7.0 promote produced 301k characters of release notes; the
GitHub Releases API rejects bodies over 125,000 with HTTP 422, which killed
the first release run after the build finished. extract-release-notes.mjs
gains an optional --max-chars flag that trims bullet-granular (never
mid-bullet), strips any dangling heading, and appends a pointer to the full
CHANGELOG.md. Without the flag the output is unchanged.
…lease 1.7.1

The 1.7.0 packages published cleanly to GitHub Packages, but installing them
showed the launcher still asked for @colbymchenry/codegraph-<target>: the
optionalDependency lives at node_modules/@malarinv/codegraph-<target>, the
require missed, the shim fell back to an upstream GitHub release that has no
v1.7.0 and 404'd. npm-shim.js and npm-sdk.js now derive the scope and
repository from the installed main package's own package.json, upstream
remaining the fallback; __tests__/npm-shim.test.ts gains a fork-scope test
that fails the download fallback by asserting it never triggers.

Version 1.7.0 -> 1.7.1 with the fix noted in CHANGELOG.
The fork ships its own releases under the malarinv owner on GitHub Packages
instead of upstream's npmjs.com OIDC setup: pack-npm.sh derives the scope and
repository URL from GITHUB_REPOSITORY, release.yml authenticates with
GITHUB_TOKEN (packages: write) and publishes to npm.pkg.github.com, and the
thin installer (npm-shim.js / npm-sdk.js) resolves its platform bundle from the
installed main package's own scope rather than a hardcoded one.

Release notes are capped at GitHub's 125k-char body limit (extract-release-
notes.mjs --max-chars 124000, bullet-granular, CHANGELOG keeps the full text).

Version 1.6.2 -> 1.7.1 for these fixes, ui/package.json synced accordingly.
@malarinv
malarinv force-pushed the release/github-packages branch from 1b04e14 to 28ec75f Compare November 7, 2026 17:39
malarinv pushed a commit that referenced this pull request Nov 11, 2026
…3e + wasm byte-copy vendor, dart default-routed (colbymchenry#1386)

R7b batch 4 #4 — the FINAL R7b language (docs/design/dart-kernel-port-checklist.md
is the authoritative quirk list). The fourth vendored-grammar-C language,
with a twist: production dart resolved its wasm from tree-sitter-wasms,
whose dart dependency is an UNPINNED github:UserNobody14/tree-sitter-dart —
a routine dependency update would have silently changed dart's grammar.
This PR byte-copies the shipping 0.1.13 artifact into src/extraction/wasm/
(VENDORED_WASM_LANGS += dart) and compiles the same-commit (d4d8f3e337d8)
parser.c/scanner.c in the kernel — table identity proven by the
kernel-grammar-parity row. crates.io tree-sitter-dart is the nielsenko
fork (different lineage) — rejected.

The center of gravity is THE SIBLING-BODY DOUBLE-WALK, reproduced
bug-for-bug: dart attaches every function/method body as a NEXT SIBLING of
its signature, and the TS walkers consume each body TWICE — once via
resolveBody (attributed to the function/method) and once via the enclosing
generic walk (attributed to the file/class). Duplicate local-function
nodes with the SAME id under different parents, duplicated
calls/instantiates refs, and file/class-attributed fn-ref twins all emit
in the exact observed interleave (a dedicated fixture pins the
duplicate-id rows; the bloc kind-census spot-check pins the counts).

Also preserved (probe-pinned): the extractBareCall selector matrix (the
first callTypes=[] language — cascades completely invisible, `?.` encodes
like `.`, the `ConfigT.load()` calls+references double emission with no
callee-of-call skip, capitalized-chain `Foo.create().run` re-encode,
const-object callee names); the constructor hooks (unnamed ctor skipped,
named ctors/factories renamed to the CTOR name with the class as
returnType, `@override (T) m()` record-misparse rescued by class-name
validation); operator methods minting `method "<anonymous>"`;
static_final_declaration constants via the visitNode hook while instance
fields mint NOTHING; the prefixed-return-type prefix bug (`other.OtherClass
f()` → returnType `other`); enum `with` mixins silent vs `implements`
working; anonymous extensions named after the ON type; deferred imports
invisible; named-argument callbacks NOT fn-ref-captured (the Flutter
`onPressed:` idiom — future accuracy PR, TS-side first); `async*`/`sync*`
NOT async; value-refs with the LIVE dart sibling-body pull and the
`$X`-vs-`${X}` interpolation asymmetry; dartdoc kept in all three comment
forms with the annotation-broken chain.

Gates: parity sweeps first-run 0-diff on shelf/bloc/flutter — 5,815 clean
files byte-parity, deferrals 10/21/1341 ≈ the survey's 10/21/~1340
(both-arm grammar reality: empty object patterns — the sealed-class
idiom — and unnamed `library;` dominate; --max-deferral 0.3); full-init
dumps byte-identical ×3 (shelf 7,959 / bloc 40,026 / flutter 1,855,319
dump lines); bloc per-kind node census identical across arms (the
double-walk duplicate rows survive the store identically);
kernel-dart-parity suite (7 fixtures + in-memory CRLF variants +
double-walk duplicate-id pin + generated-file skip pin + two defer pins);
full suite 2,688 green ×2 with CODEGRAPH_KERNEL_EXPECT=1.
DEFAULT_ROUTED += dart (20 langs — R7b COMPLETE).

Co-authored-by: Claude Fable 5 <[email protected]>
malarinv pushed a commit that referenced this pull request Nov 11, 2026
…ame-collision matches (CG-10, colbymchenry#1500)

Explore's per-file relevance awarded +50/+10/+3/+1 by match class and admitted
anything scoring >= 3. Neither half held up: the tier said HOW a symbol reached
us, never whether the match was evidence, and an absolute floor admits noise on
any repo where the top file scores 50+. Three scripts/agent-eval/*.mjs harnesses
took 63% of this repo's own "how does explore allocate its output budget" answer
on nothing but an unused `const explore` and a `const BUDGET`.

Four levers:

- KIND WEIGHT (RELEVANCE_KIND_WEIGHT): callables and types 1.0, members ~0.5,
  variable/constant/parameter 0.15-0.35. A weak-kind symbol with no usage edge
  anywhere in the graph (`contains` excluded — nesting is not usage) drops to
  0.08. Only weak kinds in the top two tiers pay for the DB probe; the subgraph's
  own edges answer most cases free. No measurable latency change (210 vs 211
  ms/call, n=12 interleaved).

- PERIPHERAL CAP: nodes >=2 hops from any match accumulate into a bucket capped
  at 5. Uncapped they added a flat +1 each, so a file grew more relevant by being
  bigger — parse-session.mjs reached 22 off one constant plus twelve unrelated
  symbols.

- RANK PENALTY: generated files x0.3, low-value x0.5, applied to the score AND
  the graph mass. Score alone would not have fixed colbymchenry#1500 — the generated CRUD
  carries MORE graph mass than the hand-written use-case, and graph mass outranks
  score in the comparator. Self-normalizing, never a hard exclusion.

- RELATIVE FLOOR: clamp(topScore * 0.2, 1, 10). Capped at one full-strength
  direct match so concentration elsewhere can never exclude one (without it a
  named-seed-heavy file pushed the floor to 21 and dropped a file the agent had
  named by class name). Backfills to 3 candidates when it would leave fewer, and
  drops the evidence requirement rather than return nothing at all.

excludeLowValueFiles was dead config — declared per tier, read nowhere; the
test/spec exclusion has been unconditional for a while. Removed. The real gap was
the detector: `isLowValue` anchored on a leading `/`, so a repo-ROOT `test/` dir
(express, cobra, most of npm and Go) never matched — express's routing question
spent 59% of its envelope on three test files. Anchored at `^` too, and the
filter now runs before the floor and judges "are there other candidates?" on the
whole gather.

Measured before/after on the same indexes (baseline bd86ad2):
- payroll-go fixture: generated 57.4% -> 23.5%; answer 25.6% -> 61.5%; cycle.go
  delivered 0 -> 38.9%. Generated ranks #3/#4, was #1/#2.
- self-query fixture: eval scripts 72% -> 0%; tools.ts ranks #1.
- express "route a request": 59% to test/* -> lib/application.js + lib/response.js
- cobra x3, codegraph "indexing pipeline": byte-identical (control)

Diagnostic gains a per-file penalty multiplier and NodeKind mix, so "why did this
file score X" is legible. Selection stages reordered to match the pipeline.

CG-6's gates flip from it.fails to live regressions except the byte-split ones,
which stay open for CG-12 (allocation still follows file size within the ranked
set).

Co-Authored-By: Claude Opus 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