Skip to content

refactor(coord): tighten path-claims/dispatcher + bench harness + CI integration#143

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/coord-postmerge-cleanup
May 24, 2026
Merged

refactor(coord): tighten path-claims/dispatcher + bench harness + CI integration#143
hyperpolymath merged 3 commits into
mainfrom
claude/coord-postmerge-cleanup

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Post-merge cleanup on top of #142. Three commits, all on top of the squash-merged #142 content:

  1. 6f861a1 — refactor. Tighten path-claims.js (cache segment-splits, single-regex // normalise, extract DEFAULT_TTL_S); split dispatcher.dispatchLocalCoord into explicit pathClaimsBefore/pathClaimsAfter hooks; DRY the shell helpers (_coord_claim_quiet shared between coord-claim and coord-worktree). Adds a PR Workflow section to .claude/CLAUDE.md documenting the squash-merge + follow-up-commit hazard that produced docs: add parallel agents and git workflow guidance #142's ghost-conflict.
  2. 9bb7df5 — bench. mcp-bridge/tests/path_claims_bench.js + just bench-bridge recipe. Reference numbers on dev host: 240k ops/s at 10 active claims, 3.9k ops/s at 1000 claims, pathsOverlap ~170 ns/op.
  3. f1e646a — CI. New bench-bridge job in e2e.yml: runs the bench, uploads artifact, posts a sticky PR comment (marker-tag find-or-update) so bench deltas show up inline across pushes. Per-job pull-requests: write override keeps workflow-level perms at read-all. Comment failure is non-fatal (continue-on-error) — token hiccups never gate the bench.

Behavioural changes

None. All 26 bridge tests stay green. Backend (Idris2/Zig) untouched.

Test plan

  • node --test mcp-bridge/tests/dispatch_test.js mcp-bridge/tests/path_claims_test.js → 26/26 pass locally
  • node mcp-bridge/tests/path_claims_bench.js → completes in ~3s, stable output
  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/e2e.yml'))" → valid YAML
  • First PR push triggers bench-bridge job; sticky comment appears with numbers
  • Second push to same PR updates the sticky comment in place (no spam)

🤖 Generated with Claude Code


Generated by Claude Code

claude added 3 commits May 24, 2026 04:24
… + PR-workflow note

Post-merge cleanup on top of #142's squash-merge. No behavioural changes —
26/26 bridge tests stay green.

* path-claims: cache segment-split per registered path so the n×m overlap
  scan inside register() stops re-splitting; collapse the O(n²) `//`
  normalisation while-loop into a single `\/+` regex; extract
  DEFAULT_TTL_S so register() and refresh() share one default; normalise
  the paths-array iteration into a small helper.
* dispatcher: split the path-claims interception into explicit
  before/after hooks (pathClaimsBefore strips the bridge-only `paths`
  field before forwarding to the verified backend; pathClaimsAfter
  registers/refreshes/releases against the response), so the dispatch
  function reads as envelope-validate → before-hook → fetch → after-hook.
* coord-hooks.sh: extract _coord_claim_quiet so coord-claim and
  coord-worktree share one parse path and interpret "granted" the same
  way; drop the duplicated python-parse blocks.
* CLAUDE.md: add a "PR Workflow" section documenting the squash-merge +
  follow-up-commit hazard that produced PR #142's ghost-conflict, with
  the empty-diff diagnostic and the post-merge cleanup recipe.
Measures register() (the hot path on coord_claim_task) across realistic
(10 claims) → stress (1000 claims) population sizes, plus the
pathsOverlap leaf primitive and bookkeeping (refresh, list). Bench
holds active-claim count stable by reusing one task slot per iter, so
the reported numbers reflect overlap-scan cost at the seeded
population — not arithmetic-series accumulation.

Reference numbers on dev host: 240k ops/s at 10 claims, 3.9k ops/s at
1000 claims, pathsOverlap ~170 ns/op. Numbers are host-dependent; use
deltas across commits, not absolute values.
Runs node mcp-bridge/tests/path_claims_bench.js on every PR/push that
touches the bridge, uploads the output as an artifact, and posts a
sticky PR comment (marker-tag find-or-update) so bench deltas are
visible inline across pushes instead of buried in the artifact tarball.

Separate job from the existing zig `benchmarks` so the JS bench gets
its own runner (no Zig install) and the logs stay untangled. Per-job
permissions override (pull-requests: write) keeps workflow-level
permissions at read-all — only the comment step needs write.

Comment failure is non-fatal (continue-on-error) so a token hiccup or
fork PR never gates the bench. Same pattern as hypatia-scan's PR
comment step.
@github-actions
Copy link
Copy Markdown

🏁 path-claims bench

Commit dcbc456

Numbers
path-claims bench  (node v22.22.3)

  scenario                                              iters       ms        ns/op          ops/s
  --------------------------------------------------------------------------------------------------------------
  register: 10 active claims, 3 new paths               50000 iters    176 ms      3.53 µs/op    283.4k ops/s
  register: 100 active claims, 3 new paths              20000 iters    318 ms     15.94 µs/op     62.7k ops/s
  register: 1000 active claims, 3 new paths              5000 iters    997 ms    199.45 µs/op      5.0k ops/s
  register: 100 active claims, 20 new paths              5000 iters    355 ms     71.01 µs/op     14.1k ops/s

  pathsOverlap: deep diverge at segment 4             1000000 iters    165 ms     165.9 ns/op     6.03M ops/s
  pathsOverlap: short prefix match                    1000000 iters    143 ms     143.5 ns/op     6.97M ops/s

  refresh (existing claim)                             100000 iters     10 ms     108.9 ns/op     9.18M ops/s
  list (100 active claims)                              50000 iters    305 ms      6.11 µs/op    163.6k ops/s

  (Bench numbers depend on host; use deltas across commits, not absolute values.)

Host-dependent — compare deltas across commits, not absolute values.

@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 110 issues detected

Severity Count
🔴 Critical 18
🟠 High 59
🟡 Medium 33

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Stale AI session file -- delete",
    "type": "stale",
    "file": "GEMINI.md",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "medium"
  },
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/sanctify-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/hesiod-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath merged commit d21a2a8 into main May 24, 2026
22 of 24 checks passed
@hyperpolymath hyperpolymath deleted the claude/coord-postmerge-cleanup branch May 24, 2026 04:38
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