Skip to content

chore: pre-v1.7.0 audit fixes#65

Merged
arapov merged 1 commit into
masterfrom
chore/pre-release-audit-fixes
May 29, 2026
Merged

chore: pre-v1.7.0 audit fixes#65
arapov merged 1 commit into
masterfrom
chore/pre-release-audit-fixes

Conversation

@arapov
Copy link
Copy Markdown
Collaborator

@arapov arapov commented May 29, 2026

Summary

Fixes from the pre-release audit (5 parallel review lanes — security, correctness, API-surface consistency, docs/claims+privacy, release mechanics — each high-severity finding then re-verified against the code). Verdict: GO for v1.7.0; these are the small cleanups, no architectural changes.

Sev Finding Fix
HIGH CHANGELOG.md [Unreleased] contradicted itself — annotations bullet said destructive (7), delete_tag_definition entry said 7→8. Both ship as the 1.7.0 notes. Annotations bullet → full-release end-state: 8 destructive (incl. delete_tag_definition), 49/8/31 = 88
MED glama.json public-registry description said "86 tools" (2 bumps stale) → 88
MED list_party_entries merged-timeline pagination over-promised a phantom next page at the 100-entry merge ceiling <=< so the feed ends honestly at the ceiling; schema doc now states the concrete ~100 ceiling + per-person workaround instead of vague "approximate"; +1 ceiling-boundary test
LOW confirm-flag.ts comment "gates 7 destructive tools" → 8
LOW (privacy) bare party-id 254022621 used as a redaction example (possibly a real tenant id) → synthetic 123456789

What the audit found clean (no action)

  • Security: all 5 new surfaces verified clean — delete_tag_definition (double confirm-gate, enum entity, positiveId tagId, no path traversal), includeLinkedPersons fan-out (concurrency-capped, no SSRF, validated ids), landing page (static, no interpolation), annotations (no destructive tool misclassified).
  • Release mechanics: published tarball ships only dist/ (no wire-trace scripts / tests / NOTES leak), npm audit 0 vulns, lockfile not dirty, shebang correct, all gates pass.
  • Privacy: whole-tree sweep clean (no banned substrings, tenant names, infra ids, tokens) apart from the LOW above.
  • Consistency: catalog still coherent — delete_tag_definition matches the destructive-tool conventions; detach-vs-delete disambiguated in both tool descriptions.

The pagination ceiling, precisely

A top-100-per-party merge reliably orders only the global top ~100 entries (each party is fetched at Capsule's per-party cap of 100). Previously, requestedWindowEnd <= 100 would advertise a page+1 at exactly the ceiling, which then returned an empty slice — a phantom page mid-feed. Strict < 100 ends the feed at the ceiling instead. Entries beyond ~100 of a specific contact are reached via list_party_entries on that person's id (the default single-GET path, no ceiling) — now stated explicitly on the schema rather than hand-waved as "approximate."

Deferred to the release cut (NOT in this PR)

The 6-location 1.6.5 → 1.7.0 version bump, [Unreleased][1.7.0] graduation, README/INSTALL pin examples, and the optional biome 2.4.16 patch are the cut itself (Flow A) — done when you say go.

Test plan

🤖 Generated with Claude Code

…privacy)

Five fixes from the pre-release audit (5 parallel review lanes +
self-verification). No architectural changes; release stays GO.

HIGH — CHANGELOG [Unreleased] self-contradiction: the annotations
  bullet said destructive "(7)" while the delete_tag_definition entry
  said "7 → 8". Both ship as the 1.7.0 notes. Fixed the annotations
  bullet to the full-release end-state (8 destructive, incl.
  delete_tag_definition; 49/8/31 = 88).

MED — glama.json public-registry description said "86 tools" (two
  bumps stale). → 88.

MED — list_party_entries merged-timeline pagination ceiling: the
  next-page check used `<= 100`, which at exactly the 100-entry merge
  ceiling promised a page+1 that then came back empty (a top-100-per-
  party merge reliably orders only the global top ~100). Changed to
  strict `< 100` so the feed ends honestly at the ceiling, and
  replaced the vague "approximate" schema caveat with the concrete
  ~100 ceiling + the per-person list_party_entries workaround for
  deeper history. Added a ceiling-boundary test (page 4 / perPage 25
  → exactly 100 → no phantom nextPage).

LOW — confirm-flag.ts doc comment said "gates 7 destructive tools" → 8
  (adds delete_tag_definition).

LOW (privacy) — replaced the bare party-id `254022621` (used only as
  a path-redaction example in log.ts/tests/docs, possibly a real
  tenant id) with an obviously-synthetic `123456789`.

Clean across the rest: security (5 surfaces verified), pack hygiene
(ships only dist/), 0 vulns, lockfile clean, shebang correct.

538 tests (+1 ceiling test). Bundle 168.47 KB stdio / 196.34 KB http.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@arapov arapov merged commit 526af21 into master May 29, 2026
1 check passed
@arapov arapov deleted the chore/pre-release-audit-fixes branch May 29, 2026 09:02
arapov added a commit that referenced this pull request May 29, 2026
#67)

Cherry-picked the genuine bits from codex PR #66, dropping that PR's
v1.6.6→v1.7.0 doc rewrites and the wire-trace-v166/v167→v170-* probe
renames (iteration markers, not release versions — rejected the same
way as #62/#64).

Real fixes the audit's docs lane missed:
  - README.md tool table: Tags row now lists delete_tag_definition
    (was added to the catalog but not the README table).
  - src/capsule/cache.ts: header + invalidateByPrefix doc comments now
    name delete_tag_definition as a third tag-mutating tool that drops
    the list_tags cache (accurate — the handler does call
    invalidateByPrefix), and generalize "/tags" → "/<entity>/tags".

Test coverage:
  - tests/cache.test.ts: delete_tag_definition invalidates the cached
    list_tags response.
  - tests/entries.test.ts: a merged-timeline window that CROSSES the
    100-entry ceiling returns the in-ceiling tail and ends the feed
    (complements the #65 boundary test with the partial-window case).

Plus a sharper PAGINATION CAVEAT wording (distinguishes crossing-window
truncation from beyond-ceiling empty) — kept the v1.6.6 provenance.

Closes #66 (cherry-picked clean). 538 → 540 tests.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant