23 Commits
Author SHA1 Message Date
JATMNandClaude Opus 5.5 a23c81d75a fix(deps): bump follow-redirects and override ws in scripts/ (#525)
Resolve Dependabot alerts for the ANS-104 golden-vector tooling in
scripts/:

- follow-redirects 1.16.0 -> 1.16.2 (lockfile only, within axios's
  ^1.16.0 range): GHSA-mrwp-f3q8-3g9p, GHSA-q3jh-wrc6-jgq8,
  GHSA-8r9p-f939-6h3c.
- ws 8.18.0 -> 8.22.1 via an npm override. @ethersproject/providers
  5.8.0 (latest v5) pins ws to exactly 8.18.0, so a lockfile bump
  alone cannot move it: GHSA-96hv-2xvq-fx4p, GHSA-58qx-3vcg-4xpx.

elliptic (GHSA-848j-6mx2-7j84, low) has no patched release and is
left as is.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-06 01:00:41 +00:00
beardthelion 5bb61cc97f ci(release): verify release provenance for backfill publishes (#523)
* ci(release): gate publish jobs on the release environment, anchor the tag check, pin npm

Closes #234. workflow_dispatch runs the selected ref's YAML and npm trusted
publishing matches on the workflow filename, not the ref, so a dispatched
non-main ref could reach the OIDC publish with no approval. Declare
environment: release on all three publish jobs (npm-publish, docker,
docker-manifest) so the environment's deployment-branch rule gates every
publish surface, not just the OIDC one.

Also close the two residuals the issue carries: the release-tag case glob
was right-unanchored (accepted v1.2.3.4.5, v1_x, v1-any-branch-name, bare
v1), now an extglob v+([0-9]).+([0-9]).+([0-9]); and the OIDC publish ran
npm@^11.5.1, a floating range, now pinned to [email protected].1.

The environment itself must exist with a deployment-branch rule limited to
main (and required reviewers if desired) for the gate to bite; npmjs.com
can also scope each package's trusted publisher to environment "release"
for a registry-side check that survives a workflow edit.

* ci(release): qualify tag checkouts and keep moving tags forward-only

Closes #271, closes #238.

actions/checkout resolves an unqualified ref as a branch before a tag, so
a branch named v0.7.1 shadows the tag and the release builds unreviewed
content. Qualify all four release-tag checkouts as refs/tags/..., which
takes checkout's unconditional tag path.

docker-manifest applied :latest and :X.Y unconditionally, so a backfill
of an older tag repointed them at older code. The manifest now always
publishes the immutable :X.Y.Z and applies the moving tags only when the
resolved version is not older than the registry's latest release. The
same shape existed on the npm side: publish moves the latest dist-tag to
whatever it publishes, so a backfilled older version would have stolen
it; older backfills now publish under the backfill dist-tag instead.

The manifest also asserted nothing about the digest set it stitches, so
a wrong-arity or misnamed artifact would ship under :latest. Assert two
digests of 64 lowercase hex chars before imagetools create.

Extend the resolver test to pin both publish steps byte-for-byte and to
reject any unqualified tag-checkout ref, so these guards cannot regress
silently.

* ci(release): gate every job on the release environment and verify tag provenance

Two residuals from review of the dispatch-publish surface:

- environment: release only covered the three registry-publish jobs. Declaring
  it on all eight jobs means a dispatch of unmodified YAML on a non-main ref
  is denied by the environment's deployment rules before any step runs.
- The resolver shape-checked vX.Y.Z but did not prove the tag was produced by
  the release flow. A write-access user could plant a v99.99.99 tag on
  unreviewed content and dispatch a backfill against it. In CI (GH_TOKEN
  present) the resolver now requires a GitHub release for the tag and a
  main...tag compare status of identical or behind, so the tag's commit must
  already be reachable from main.

* ci(release): qualify the provenance compare and fail closed on npm lookup errors

Second adversarial pass found two residuals:

- The provenance check compared main...<tag> with an unqualified refname,
  the same branch-shadows-tag ambiguity the refs/tags/ checkout prefix was
  added to avoid. Resolve the tag through commits/refs/tags/<tag> to a
  commit SHA and compare that instead.
- npm view ... || true mapped every lookup failure to "no latest", so a
  registry outage during an older backfill would publish under --tag
  latest and move the dist-tag backward. E404 still means first publish;
  any other failure now aborts before a dist-tag is chosen.

* ci(release): check release author, decide npm dist-tag per package, close the test gap

Third adversarial pass:

- Provenance now also requires the release to be authored by the release
  automation account, so a hand-created release on a valid tag does not
  qualify for backfill.
- The npm dist-tag decision is per package. A partial publish can leave
  platform packages ahead of the wrapper, and a single lookup on
  @gitlawb/gl would then downgrade an ahead package's latest tag.
- The environment gate test now emits one line per job and marks jobs with
  no declaration MISSING, so a job added without environment: release can
  no longer pass silently.

* ci(release): anchor docker moving tags to the registry floor, not the release pointer

GitHub's latest-release pointer is operator-mutable and is not a bound on
what :latest serves. List the package's versions on ghcr and refuse to
move :X.Y or :latest below the newest X.Y.Z tag there. A 404 means the
package does not exist yet, so the first publish applies all tags; any
other lookup failure aborts. The version filter is grouped with || true so
an empty list does not trip pipefail.

* ci(release): require backfill release assets to be automation-uploaded

The npm backfill republishes GitHub release assets, which are mutable for
anyone with contents: write. Require every asset on the release to have
been uploaded by github-actions[bot], matching the release-author check.
Not a hard bound, but it removes the direct edit path and leaves a review
signal when a hand-uploaded asset blocks a backfill.

* ci(release): pin the verified commit and the exact asset bytes end to end

The provenance checks ran at resolve time but the consumers re-resolved
mutable names afterward, leaving a move-the-tag or replace-the-asset race:

- Checkouts now use the commit SHA the resolver emitted (tag_commit),
  falling back to the qualified tag ref.
- The resolver captures the release's name/id asset pairs once, checks all
  uploaders against them, and the lay-in step downloads by asset id. An
  asset deleted and reuploaded between resolve and download gets a new id
  and fails closed.
- The npm-publish comment now names the third trusted-publisher component
  (environment), which is what binds the OIDC token to the gate.

* ci(release): run the resolver on the producer path and hash homebrew inputs locally

- release-binaries and web-sync now resolve the release tag and check out
  the verified commit SHA, closing the tag-move race on the job that
  produces the release assets, not just the jobs that consume them.
- homebrew-bump resolves the tag, downloads the tarballs by captured asset
  id, and computes sha256 locally instead of trusting the mutable
  *.tar.gz.sha256 sidecar assets.
- The step pin now covers the lay-in, formula, and release-tag checkout
  blocks so edits to the trust boundary force a deliberate fixture update.

* ci(release): bind the tag to the commit its release was created against

Reachable-from-main alone accepts a tag moved to any other main commit.
The release object records its creation-time target_commitish, so require
tag_commit == release.targetCommitish: a moved tag now fails closed, and
the SHA emitted for checkouts is provably the released commit.

* ci(release): force bash for the release-binaries resolver step

The matrix includes windows-latest where run: defaults to pwsh, and the
resolver body is bash.

* ci(release): base64 release-asset names in the resolver map

Release asset names are attacker-controlled text. A crafted name
carrying whitespace could smuggle a fake uploader into the third
positional field and pass the automation-only check. Emitting names
base64-encoded keeps each record in three real fields and makes the
name-to-id lookup immune to injection.

* Address PR review feedback (#447)

- floor the docker minor-line tag at its own X.Y max so an
  in-line-newest backfill advances :X.Y without moving :latest

* Address PR review feedback (#447)

- serialize all release runs under one concurrency group; the
  ref-keyed group let dispatches from different refs interleave

* ci(release): freeze docker moving tags on dispatch, retire the registry floor

* ci(release): make the resolver test's gh stub discriminate on the full call

* ci(release): assert the pinned npm version took effect

* ci(release): surface missing-asset errors from the formula sha() subshell

* ci(release): consume resolver outputs instead of release-please outputs post-resolve

* ci(release): document the concurrency group's pending-slot replacement

* ci(release): share the image output and bound the step scanners to jobs

The docker-manifest rel step now emits image= the same way the docker
job's does, and both manifest steps consume steps.rel.outputs.image
instead of recomputing the lowercase ghcr path.

The three whole-workflow awk scanners now ignore everything before
jobs: and flush at job boundaries, so an `on.push.branches` list item
can no longer open a pseudo-step that swallows top-level YAML, and a
step record can no longer absorb the next job's header lines.

* ci(release): close the review-found evasions in the release checks

Review of the follow-up diff found the structural assertions could be
satisfied or evaded without the behavior they guard:

- the gh stub now pipes a fixture response through real jq with the
  caller's own -q on every arm, so a resolver that hardcodes its
  expected fields is detected
- the moving-tag scan keys on the outcome (a push mechanism plus a
  mutable-tag reference in decommented step text) and requires the
  event+ref guard on the carrier's if: line, instead of binding one
  argv spelling and accepting comment-borne guard text
- a new assertion pins the on.push.branches / workflow_dispatch
  triggers, which no step-level check could see
- the npm check detects install/i and -g/--global variants, requires a
  non-empty install set, and reads the pin comparison from code, not
  comments
- the stale-reads scan covers first step lines, job-level env/if lines,
  and jobs without a resolver step
- the resolver test asserts the GHAE heredoc terminator, clears ambient
  GH_TOKEN/GITHUB_REPOSITORY on non-stub calls, and prints the captured
  resolver stderr when a pass-expected case fails
- sha() exits on a failed download, since errexit is off inside its
  command substitution and a truncated file would otherwise be hashed

* ci(release): floor the moving tags against the releases list

The event gate alone cannot bound a stale run: a re-run of an older
push run replays its stored needs outputs under the original event and
ref, and would move :latest and :X.Y backward to that run's version.
The gated step now derives the newest published release from the live
releases list (contents:read, drafts and prereleases excluded) and
refuses when this run's version is not the maximum. The check reduces
to VERSION == max, because the run's own release already exists by the
time the step runs.

The all-steps assertion now requires the carrier to carry the floor as
well as the event+ref guard, and the red-check spec gains a
gated-but-floorless carrier mutation to prove the clause binds.

* ci(release): pin the rebranded Homebrew formula text in the resolver-steps test

* ci(release): keep npm stderr out of the dist-tag lookup

The Publish step captured `npm view ... dist-tags.latest` with 2>&1, so a
warning on stderr from a successful lookup became part of registry_latest and
could make a new release compare as older than the registry latest, publishing
it under the backfill dist-tag instead of latest.

Send stderr to a temp file and read it only when the lookup fails. E404 still
means the package was never published, and any other failure still fails
closed. The pinned copy of the block in the resolver test is updated to match,
and a stubbed-npm test covers a warning on success, a clean lookup, a genuine
backfill, E404 and a non-E404 failure.

* ci(release): bound the moving tags against every release page

The Move floating tags step floored a stale re-run against the semver maximum
of the first page of the releases list only. That list is ordered by creation,
not semver, so once history passes one page the true newest version could sit
on a later page and a stale re-run would move :latest and :X.Y backward.

Read every page with gh api --paginate and take the semver maximum in bash.
The gh call stays its own command substitution so a failure on any page still
fails closed, and an empty list still yields no floor. The pinned copy in the
resolver test is updated to match, and a stub-gh test serving two pages covers
a stale run whose newer release is only on page 2, the run that is the newest,
a gh failure, and an empty list.

* ci(release): fail closed when a release asset has no uploader login

The resolver ran its automation-only asset check only when the collected
uploader list was non-empty. A null uploader login made jq emit an empty third
field, the list collapsed to nothing, and provenance passed although no asset
was shown to be automation-uploaded.

Substitute a sentinel for a missing login so every asset row carries a value
and a null, missing, or login-less uploader fails the existing comparison. The
base64 name and id map is unchanged, and a release with no assets behaves as
before. The resolver test covers an all-null uploader, a null login, a missing
uploader key, a bot asset mixed with a null one, and the all-bot release.
2026-11-05 21:51:35 +00:00
beardthelionandGravirei 2c341f71ac fix(node): ANS-104 codec and recovery policy types (#26 split 2/4) (#524)
* fix(node): ANS-104 transport, three-outcome probe, verify endpoint (#26 split 2/4)

Reviewer 2 closed PR #224 on 2026-08-28 with a directive: split
into four narrow PRs. This is Split PR 2 (Arweave transport and
verification).

The P1 finding the reviewer assigned to this split: the legacy
`anchor_item_present` mapped `BAD_REQUEST` and `GONE` to `Ok(false)`,
and the recovery code interpreted false as permission to reclaim the
row and pay for another upload. Neither 400 nor 410 proves a
previously paid item was never accepted: 410 can describe an
artifact that existed but is no longer served, and 400 can be
produced by gateway, proxy, or routing failure. The concrete
failure sequence the reviewer named: bundler accepts the item,
the response or terminal DB write is lost, recovery probes the
persisted item_id, the gateway returns 400 or 410, and the node
pays for a second immutable item for the same transition.

Fix: model the probe result as three outcomes, and authorize a
re-upload only on a trustworthy, protocol-defined absence.

NEW MODULE crates/gitlawb-node/src/ans104.rs
  - DataItem: the on-wire ANS-104 shape (signature, owner, target,
    anchor, tags, data — all base64url-encoded except target/anchor).
  - deep_hash: the canonical signing input per the spec. The
    signature is over a SHA-256 mix of the dataitem/list/map
    discriminators, the signature type, owner, target, anchor, the
    recursively-hashed tag list, and the data payload. A
    hand-rolled sha256 of the JSON body would produce a hash no
    Arweave gateway would recognize; the deep-hash is the only
    correct form.
  - sign_data_item: Ed25519 over deep_hash.
  - verify_data_item: parses the owner, checks the signature against
    an expected pubkey, and reports a specific failure reason on
    each branch.
  - 7 unit tests covering round-trip, flipped signature, wrong
    expected key, mutated data, wire-shape round-trip, deep-hash
    stability, and the empty-tags edge case.

NEW MODULE crates/gitlawb-node/src/arweave_v2.rs
  - ProbeOutcome: Present (2xx, body parses as ANS-104, sig
    verifies), DefinitivelyAbsent (404 with a known JSON body
    shape), Indeterminate (everything else). The reviewer's
    three-outcome model.
  - ProbeOutcome::permits_reupload: the recovery policy. ONLY
    DefinitivelyAbsent authorizes a paid re-upload. Indeterminate
    keeps the outbox non-terminal; Present skips re-payment.
  - probe_anchor_item: the gateway probe. 2xx bound to a different
    item id is Indeterminate, not Present. 2xx with a body that
    does not parse as ANS-104 is Indeterminate. Oversized bodies
    are Indeterminate (defense against body-stuffing).
  - read_capped_body: enforces PROBE_MAX_BODY_BYTES (1 MiB) on the
    full body, with a Content-Length fast-path that rejects
    before reading.
  - verify_anchor: the full path the public verify endpoint takes.
    Fetches the data item, parses it, verifies the Ed25519
    signature against the persisted node_did, decodes the data
    payload as JSON, and reports the result.
  - 15 unit tests pinning each classification boundary:
    400/410/5xx/transport/2xx-non-json/2xx-bad-sig/2xx-different-
    owner are all Indeterminate; 404 with empty or known-JSON
    body is DefinitivelyAbsent; 2xx with a valid signed item is
    Present; the re-upload policy is exhaustive.

NEW DB METHOD crates/gitlawb-node/src/db/mod.rs
  - get_arweave_anchor_by_item_id: looks up an existing
    arweave_anchors row by its id (which is the Irys tx id, the
    same value the Arweave gateway uses to serve the data item).
    Used by the public verify endpoint to fetch the persisted
    node_did so the envelope signature can be verified against it.

NEW CONFIG crates/gitlawb-node/src/config.rs
  - GITLAWB_ARWEAVE_GATEWAY_URL: the Arweave gateway the probe
    reads from. Defaults to https://arweave.net; operators can
    point it at a private mirror.

NEW HTTP ENDPOINT crates/gitlawb-node/src/api/arweave.rs
  - GET /api/v1/arweave/anchors/verify/{item_id}: the public
    verify endpoint. Returns {item_id, status, verified,
    owner_did, data_payload, error} where status is one of
    "verified" / "definitively_absent" / "indeterminate".
  - 3 endpoint-level tests covering the verified, 404, and 400
    shapes via the live router, asserting the public surface
    surfaces the three outcomes.

WIRE-UP crates/gitlawb-node/src/server.rs
  - The verify route is registered alongside the existing
    /api/v1/arweave/anchors list route.

NOT IN THIS SLICE (the bundler upload, the next commit):
  - The handler that builds a DataItem from a ref-cert and POSTs
    it to the bundler is not in this PR. The ANS-104 module is
    ready to be called by it; the cert/push-event flow in PR 1
    persists the row that the bundler upload would consume.
  - PR 1's recovery drain produces an `anchor_jobs` row keyed on
    the (repo, ref, old, new) tuple; the next slice reads that row,
    builds the ANS-104 data item, POSTs to the bundler, and writes
    the resulting tx id to arweave_anchors.

Compiles clean, 1113 tests pass with 0 regressions, clippy clean
under -D warnings, fmt clean.

Cross-PR overlap (declared in the PR description):

  - #134 (anchors auth): composes. The verify endpoint reads from
    arweave_anchors; #134's auth layer applies unchanged. The
    probe model is server-side and unauthenticated by design.
  - #285 (advisory-lock session affinity): independent. The probe
    is read-only.
  - #306 (Content-Digest on signed requests): independent. The
    probe does not sign requests.
  - #314 (small-order Ed25519): composes. The verify path calls
    Did::to_verifying_key which already enforces the small-order
    check from #314.
  - #324 (libp2p keypair persistence): independent.
  - #325 (gossip ref-update auth): independent. The verify path
    is for the public Arweave gateway, not gossip.
  - #382 (replication withheld-subtree trees): independent.

* fix(node): address reviewer findings on #26 split 2/4 (transport)

- P1 (DB lookup): get_arweave_anchor_by_item_id now filters on
  irys_tx_id (the externally-routable item id) rather than the
  internal UUID primary key. The production writer stores a fresh
  UUID in `id` and the Irys response / ANS-104 derived id in
  `irys_tx_id`; the old filter would always 404. New
  integration tests exercise the production writer path with
  distinct values for the two columns.
- P1 (verify-gate): verify_anchor now gates on repo read via
  authorize_repo_read. The route is split in server.rs: the
  public list_anchors stays ungated (#134 tracks that surface),
  the verify route gets optional_signature per the team memory
  `axum-layer-vs-merge-pitfall.md`. Denials on row-lookup, gate,
  and missing repo all collapse to the same opaque 404 so the
  public endpoint does not leak anchor-row existence.
- P1 (ANS-104 deep-hash): rewritten to the verified SHA-384
  recursive list/blob algorithm (matches `arbundles` JS
  reference). deep_hash returns [u8; 48]; signature is over the
  raw 48-byte digest. Three reference vectors from
  `Irys-xyz/arbundles/src/__tests__/deepHash.spec.ts` are
  bit-exact-asserted as the interop canary per the team memory
  `self-roundtrip-tests-do-not-prove-interop.md`.
- P1 (artifact-identity): v2 verify now derives the protocol id
  via DataItem::id() (base64url(SHA256(signature))) and requires
  equality with the requested URL item_id. A node key signs
  many data items, so a valid signature only proves who signed
  the response — not that the served item is the one the caller
  asked to verify. The team memory
  `verify-against-artifact-id-not-signer.md` is the policy.
- P1 (verifier can't read this head's writes): verify_anchor
  now accepts BOTH the v2 ANS-104 format and the v1 raw-JSON
  shape the live path on this branch actually writes. The v1
  path does a field-equality check on repo, ref_name, old_sha,
  new_sha, node_did against the persisted row (no signature in
  v1; Irys storage plus the JSON parse are the integrity
  guarantee).
- P2 (ProbeOutcome in result): AnchorVerifyResult now carries
  outcome: ProbeOutcome. The HTTP handler maps the structured
  field to the status string instead of parsing the human-
  readable error message — any future wording change in
  arweave_v2.rs can no longer silently reclassify a
  DefinitivelyAbsent as Indeterminate.
- P2 (empty 404 body): classify_404 returns Indeterminate for
  bodyless 404s. The team memory
  `distinguish-unknown-from-empty.md` is the policy: a
  bodyless 404 from a proxy is not a proof of absence, and the
  recovery policy (permits_reupload -> true on
  DefinitivelyAbsent) authorizes a paid, irreversible re-upload.
- P2 (streaming cap): read_capped_body no longer uses
  resp.bytes() (which buffers the full response before checking
  size). It now reads chunk-by-chunk and aborts the moment the
  cumulative byte count crosses the cap, so a chunked response
  without Content-Length cannot force unbounded allocation.

* fix(node): address three reviewer findings on #26 split 2/4 (round 2)

* fix(node): address five reviewer findings on #26 split 2/4 (round 3)

* fix(node): address reviewers round-4 on #26 split 2/4 (interop)

* fix(node): address coderabbit on #26 split 2/4 (raw tags, vint overflow, golden key)

* fix(node): enforce artifact-id in probe_item on #26 split 2/4

* fix(node): require expected owner for probe Present on #26 split 2/4

* fix(node): narrow #26 split 2/4 to codec and policy types

* fix(node): silence dead-code for deferred slice API on #26 split 2/4

* fix(node): doc and bounds-check cleanup in ans104 on #26 split 2/4

* docs(node): point tests doc at Ed25519 golden script on #26 split 2/4

* fix(node): strict owner lengths, sign-before-hash on #26 split 2/4

* fix(node): keep ans104 tags and field widths consistent on hash and encode

DataItem keeps both the decoded `tags` and the original Avro `raw_tags`, both
public. After a parse, changing `tags` left deep_hash and verify_data_item
using the stale raw bytes, and to_binary wrote a header tag count that no
longer matched the payload, so the frame failed to parse back.

Take the tag block for hashing and encoding from one helper that decodes
`raw_tags` and requires it to equal `tags`, and fail closed otherwise. The
header count comes from the same validated pairs. Parsed multi-block and
size-prefixed items still re-encode byte-exact and keep their signatures.

deep_hash now also rejects a non-empty target or anchor that is not 32 bytes,
as to_binary already does, so sign_data_item fails instead of signing an item
that cannot be encoded. The legacy non-base64url anchor fallback is kept.

The module and signature-type docs now say binary parsing accepts sigtypes 1
to 4 while signing and verifying are Ed25519 only on this slice.

* build(scripts): declare the golden script's direct npm dependencies

ans104_golden_ed25519.mjs imports bs58, @noble/ed25519 and base64url, and
ans104_golden.mjs imports base64url, but package.json listed only arbundles, so
they resolved only through hoisting. Declare them at the versions already
locked, update the lockfile root entry (no resolved version or hash changes),
and note the regeneration command in the golden output file.

---------

Co-authored-by: Gravirei <[email protected]>
2026-11-05 21:12:46 +00:00
beardthelionandKevin Codex cd27756134 ci(triage): match test as a name segment, not just a whole component (#277)
* ci(triage): match test as a name segment, not just a whole component

#202 landed the namespaced-attribute fix, so main already detects
#[tokio::test] and #[sqlx::test]. What it still misses is a third-party
harness whose final path component carries `test` as an underscore
segment. #[test_case(1)] and #[wasm_bindgen_test] both fall through and
wrongly earn the PR a needs-tests label.

Widen the final component to (?:[A-Za-z0-9]+_)*test(?:_[A-Za-z0-9]+)*,
keeping the leading ::, the r# form, and the whitespace tolerance #202
added. Differential over 972 real file-patches from 400 commits: no
verdict changes either way, so this is a forward-looking net for
harnesses the tree does not use yet, not a fix for a current mislabel.

Segment rather than substring, on purpose. addsInlineTest suppresses the
label when it matches, so a false positive is the quiet failure:
#[contest] or #[latest] would clear needs-tests on a PR that added no
tests and nobody would notice. The cost is the harness names with no
underscore, such as #[rstest], which stay unmatched and produce the loud,
author-correctable failure instead.

The segment classes are [A-Za-z0-9]+ rather than \w+ so that `_` is only
ever the literal delimiter. \w+ contains `_`, which makes the repetition
ambiguous and backtracks exponentially. That matters here specifically
because the workflow triggers on pull_request_target, so f.patch is
fork-controlled text on a privileged runner: with \w+, `#[test` followed
by a long `_a` run took 71ms at 22 characters and roughly quadrupled
every two more, which stalls the triage job for any contributor who can
open a PR. The character-class form measures linear across every
adversarial input tried.

* fix(ci): allow Rust token separators before test attribute delimiters

The needs-tests inline detector required ] or ( immediately after horizontal
whitespace, so valid spellings like #[test /* rationale */] or a path split
across added patch lines still triggered needs-tests. Match block comments,
line breaks, and split-line closers instead.

* ci(triage): scan attribute closers token-aware, bound to adjoined added lines

The two-regex fallback matched a path-only attribute line and a ]/( line
anywhere else in the patch, so unrelated records could complete each other
and silently clear needs-tests; the mandatory separator regex also dropped
legal //-to-newline and nested block comments, relabeling real tests.
Replace both with one forward token scan that starts on the attribute's
added line, continues only through immediately adjoined added lines under
a hard bound, and answers 'no inline test' on anything uncertain.

Fence the detector for extraction and add scripts/test-pr-triage-detect.mjs,
run by a new pr-checks job, since pull_request_target executes the target
branch's workflow and can never exercise the proposed body.

* fix(ci): skip test attributes inside raw strings, block comments, and strings

patchAddsInlineTest had no Rust lexical state, so a #[test_case] inside a
raw string (r#"..."#), block comment, or regular string literal, followed
by ] or ( on an adjoining added line, falsely cleared needs-tests. That is
the silent failure direction the detector is supposed to fail loud against,
and it is newly reachable because the underscore-segment regex introduced
by this branch matches forms the old test\b did not.

A pre-pass now walks every patch line (context and added, not removals)
tracking raw strings (r#*", br#*", cr#*"), block comments (/* */ with
nesting), regular strings (which can span newlines in Rust), and line
comments. Added lines that start inside any of these are skipped as
candidates. The pre-pass resets at hunk headers, is O(n) in patch length,
and only sees what the patch shows: a non-code region opened before the
first context line of a hunk is invisible, and the candidate is still
scanned (conservative, fails toward the loud label).

Also corrects the failure-direction comment in test-pr-triage-detect.mjs:
false positives suppress needs-tests (they set touchedTests, which clears
the label), while false negatives apply it (the loud, corrigible
direction). The previous text had them backwards.

Adds 7 regression cases: raw-string, block-comment, no-hash raw-string,
and multiline regular-string false positives (reject), plus raw-string,
block-comment, and regular-string closing before a real test attribute on
the next added line (accept). Revert-check confirmed the pre-pass is
load-bearing for both the nonCodeStart skip and the inString carry:
disabling either makes the corresponding reject cases go RED, restoring
makes all 31 pass.

* fix(ci): recognize char literals so their contents cannot open string state

The lexical pre-pass in patchAddsInlineTest missed real tests when an
earlier added line contained a double-quote char literal like '"' or
b'"'. The scanner saw the " inside the char token and set inString,
which persisted to the next line and suppressed a following #[test].
Add bounded char-literal recognition: on seeing ', look ahead 2-4 chars
(or to } for \u escapes) for a closing '. If found, skip the whole
literal. If not, it is a lifetime or label, and the apostrophe is
skipped as a regular char. Not a skip-to-next-' rule; lifetimes and
labels fall through unchanged.

* fix(ci): bound the \u{ escape scan to prevent quadratic stall

The char-literal pre-pass scanned to the next } with no bound when it
saw \u{, so a fork-controlled patch repeating '\u{ thousands of times
made the triage job quadratic (21s for 30000 reps). Bound the scan to
20 chars past the { (a valid \u{...} holds at most 6 hex digits). Add a
runtime probe for the malformed-escape shape.

* chore: refresh PR head

---------

Co-authored-by: Kevin Codex <[email protected]>
2026-11-05 16:33:22 +00:00
JATMNandClaude Opus 5.5 e2ae21795a chore: rebrand user-facing gitlawb references to Twigpine (#520)
* chore: rebrand user-facing gitlawb references to Twigpine

Rename the product name in docs, README, CLI help/output, MCP tool
descriptions, macOS app strings, installers, npm metadata and license
headers from gitlawb/Gitlawb to Twigpine. Point GitHub links at the
renamed Twigpine org (and fix the release workflow's repository guard,
which still matched Gitlawb/node), and switch the public node hosts and
website/install URLs to twigpine.com.

Protocol and operator identifiers are intentionally unchanged
(did:gitlawb, gitlawb://, signing domains, GITLAWB_* env vars, crate
and binary names, X-Gitlawb-* headers, icaptcha and peer-network URLs);
they need a follow-up migration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: point image pulls at ghcr.io/twigpine/node and fix macOS DMG name

The release workflow publishes the container image to
ghcr.io/${GITHUB_REPOSITORY,,}, which is ghcr.io/twigpine/node since the
org rename; the old ghcr.io/gitlawb/node path no longer resolves for
anonymous pulls. Point the RUN-A-NODE docker run example, the OSS
readiness audit's claim about it, and the macOS app's generated compose
file at the published path.

The README listed the macOS DMG as "Twigpine Node.dmg", but
build-macos-app.sh writes GitlawbNode-macOS.dmg (kept on purpose), so
document the real file name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(infra): keep the AWS security group description to avoid replacement

`description` on aws_security_group is ForceNew, so renaming it forced a
replace of the in-use group on the next apply of an existing deployment.
Restore the original text and note why it must stay until a separate
infra migration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(macos): regenerate the app's compose file instead of treating it as a repo's

Config.repoPath fell back to the data directory when no repo clone was
found, and DockerCompose then picked up the compose file it had generated
there as if it belonged to a repo. The generator therefore only ran on
first launch, so upgraded installs kept their original compose, including
the old ghcr.io/gitlawb/node image, which no longer serves anonymous pulls.

repoPath now returns nil when there is no clone, and the app regenerates
its compose file whenever no repo compose is in use. Project directory and
named volumes are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(infra): default the AWS node image to ghcr.io/twigpine/node

release.yml publishes to ghcr.io/${GITHUB_REPOSITORY,,}, which is now
ghcr.io/twigpine/node; ghcr.io/gitlawb/node denies anonymous pulls, so the
default made new deployments fail to start and the upgrade command fail
on existing ones. On an existing deployment `terraform apply` only updates
the upgrade SSM document in place (user_data drift is ignored); the new
image is pulled on the next upgrade_command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(macos): keep operator edits to the generated compose, migrate only the image

e04efe4 regenerated the app's compose file on every access, overwriting
edits operators make to pass settings the generated environment block
omits (e.g. GITLAWB_OPERATOR_STRICT_MODE). Generate the file only when it
is missing; when it exists, keep it and rewrite only references to the
retired ghcr.io/gitlawb/node image, keeping tags and digests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(macos): only migrate complete ghcr.io/gitlawb/node references

Without a left boundary the migration also rewrote the retired path when
it appeared inside a longer reference, such as a registry mirror
(registry.example.com/ghcr.io/gitlawb/node), pointing it at a path the
mirror may not have.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-04 21:58:29 +00:00
Kevin Codex 6668525f41 Merge pull request #286 from Gitlawb/fix/icaptcha-release-versioning
fix(release): bump icaptcha-client with the rest of the workspace
2026-08-10 12:11:19 +08:00
mike dfe52dc8dd test(ci): pin release resolver checkouts 2026-08-05 01:22:10 -04:00
mike bc0895299c test: snapshot resolver whitespace 2026-08-05 01:22:10 -04:00
mike fa5cd65031 test: pin release resolver steps 2026-08-05 01:22:10 -04:00
mike 4c1d7814d4 test(ci): bind resolver job mutation 2026-08-05 01:22:10 -04:00
mike af5a3888a8 test(ci): harden release workflow guard 2026-08-05 01:22:10 -04:00
mike ab653e9b94 test(ci): stabilize release bypass fixture 2026-08-05 01:22:10 -04:00
mike fe07564837 test(ci): harden release tag drift guards 2026-08-05 01:22:10 -04:00
mike eac0cf7bca test(ci): enforce release tag invariants 2026-08-05 01:22:10 -04:00
mike 62513c8555 test(ci): cover remaining invalid release tags 2026-08-05 01:22:10 -04:00
mike 1b65f70403 fix(ci): add tested release tag resolver 2026-08-05 01:22:10 -04:00
beardthelion 6a405f65f1 fix(release): scope the annotation check to the [package] table
The coverage gate matched `# x-release-please-version` anywhere in a manifest,
so an annotated `version` under any other table satisfied it. A crate could
leave the version cargo actually reads unannotated, pass the gate, and still
freeze at release time, with release-please rewriting the decoy line instead:
the exact failure this gate exists to catch.

Scope the match to the [package] table.
2026-08-03 09:45:17 -05:00
beardthelion 4f424693b8 fix(release): bump icaptcha-client with the rest of the workspace
icaptcha-client became a workspace member in #138, after #130 last wrote
release-please-config.json, and nothing updated extra-files. release-please
rewrites a version line only when the line carries the annotation AND the
manifest is listed, so the crate was skipped every release and sat at 0.4.0
while the other five walked to 0.7.1.

Nothing broke: every intra-workspace path dep is bare, so no version
requirement could go unsatisfied; no crate is published to a registry; and
the crate reads no CARGO_PKG_VERSION of its own. The cost was the workspace
Cargo.toml comment asserting a lockstep rule the config did not keep, which
is what the next person adding a crate would read and copy.

Add the missing entry, and gate the rule so it cannot silently lapse again.
The gate derives its required set from `cargo metadata`, so a new crate reds
CI whether or not its author knows the gate exists, and it covers all three
release-silent shapes: a member absent from extra-files, a member whose
version line lost the annotation, and an extra-files path that is no longer
a member.

Next release moves icaptcha-client 0.4.0 to the current workspace version in
one step. Nothing depends on that version, so the jump is cosmetic.
2026-07-30 08:54:33 -05:00
t ebfe89d1c9 ci: declare the lock-sync toolchain and extend --locked to the shipping builds
sync-release-lock ran cargo update --workspace on whatever Rust the
ubuntu-latest image shipped, so the lock it wrote for the release PR came
off an undeclared input. Install the same stable toolchain the other
cargo jobs use. This does not make resolution identical (stable moves,
and the MSRV gate checks the same lock on 1.91), it just removes the
runner image from the equation.

The release-binaries build, both Dockerfiles and the darwin path of
build-bins.sh also resolved without --locked, so a lockfile disagreeing
with the manifests was caught on the PR gates but not where artifacts
are actually produced. Add --locked to all five.

Two of those five cannot reach resolution today and are hardened for
when they can: the Dockerfile dep-cache layer at line 24 copies four of
the workspace's six member manifests, so cargo dies at workspace load and
|| true swallows it, and Dockerfile.bins pins rust:1.85 against a 1.91
MSRV. Both are pre-existing and left alone here. The live coverage comes
from release.yml, Dockerfile:37 and build-bins.sh.

The gitlawb-core dependency-purity gate still resolves without --locked
on purpose, but its comment justified that by saying the build and test
jobs do the same, which stopped being true when those jobs gained
--locked. Restate the real reason: a stale lock would red that gate for
something unrelated to the dependency closure it checks.
2026-07-28 16:28:27 -05:00
beardthelion e9d6aadd58 ci(core): add dependency-purity allowlist gate for gitlawb-core
gitlawb-core is embedded by gl, git-remote-gitlawb, and the node daemon,
so it must stay lean. Add a CI gate that fails if its normal (non-dev,
non-build) transitive dependency tree gains any crate not on an explicit
allowlist.

The allowlist is exhaustive-by-construction: a new heavy dependency reds
CI whether or not anyone thought to ban it, which a denylist cannot do.
The checker resolves like the build/test jobs (no --locked, since the
committed lockfile can lag the manifests) and snapshots/restores
Cargo.lock so a local run leaves no working-tree side effects.

- ci/gitlawb-core-allowed-deps.txt: the 83 current normal deps, plus the
  regeneration command and rationale in the header
- scripts/check-gitlawb-core-deps.sh: recompute and diff; hard-fail on a
  non-allowlisted crate, note-only on a stale (removed) allowlist entry
- pr-checks.yml: new hard-fail core-deps-purity job, matching the pinned
  action SHAs and style of the sibling jobs
2026-07-22 12:04:34 -05:00
Vasanth T d366fc6b97 [codex] chore: add live-safe OSS readiness pass (#14)
* chore: add live-safe OSS readiness pass

* fix(node): verify optional peer signatures during rollout

* docs: rewrite README for node roadmap
2026-05-28 15:34:47 +08:00
Rimantas (Rimas) MoceviciusandRimas Mocevicius d09c23da86 feat: macOS menu bar app for managing gitlawb-node Docker Compose stack (#8)
- Menu bar icon with colored status dot (green/yellow/red)
- Start/Stop node via Docker Compose
- Settings UI: ports, public URL, postgres password, auto-sync, operator config
- View Logs window with live docker compose logs
- Auto-start on launch and login (SMAppService)
- Docker detection with install prompt
- Repo root detection via compile-time path for local builds
- Port variables wired through docker-compose.yml for custom port support
- GITLAWB_AUTO_SYNC passthrough for peer replication toggle
- Build script: scripts/build-macos-app.sh (codesign + DMG)

Co-authored-by: Rimas Mocevicius <[email protected]>
2026-05-27 09:37:36 +08:00
Kevin CodexandOpenClaude 6b9c5278d4 chore: initial public release
Open-source release of the gitlawb node, CLI, and git remote helper.

- gitlawb-node: Axum HTTP server with git smart-HTTP and DID auth
- gl: command-line client (identity, repos, PRs, MCP server)
- git-remote-gitlawb: git remote helper for gitlawb:// URLs
- gitlawb-core: shared crypto primitives (DID, CID, HTTP sigs, UCAN)

Dual licensed under MIT or Apache-2.0.

Co-Authored-By: OpenClaude <[email protected]>
2026-04-29 16:34:27 +08:00