refactor(coord): tighten path-claims/dispatcher + bench harness + CI integration#143
Merged
Merged
Conversation
… + 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.
🏁 path-claims benchCommit NumbersHost-dependent — compare deltas across commits, not absolute values. |
🔍 Hypatia Security ScanFindings: 110 issues detected
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Post-merge cleanup on top of #142. Three commits, all on top of the squash-merged #142 content:
6f861a1— refactor. Tightenpath-claims.js(cache segment-splits, single-regex//normalise, extractDEFAULT_TTL_S); splitdispatcher.dispatchLocalCoordinto explicitpathClaimsBefore/pathClaimsAfterhooks; DRY the shell helpers (_coord_claim_quietshared betweencoord-claimandcoord-worktree). Adds aPR Workflowsection to.claude/CLAUDE.mddocumenting the squash-merge + follow-up-commit hazard that produced docs: add parallel agents and git workflow guidance #142's ghost-conflict.9bb7df5— bench.mcp-bridge/tests/path_claims_bench.js+just bench-bridgerecipe. Reference numbers on dev host: 240k ops/s at 10 active claims, 3.9k ops/s at 1000 claims,pathsOverlap~170 ns/op.f1e646a— CI. Newbench-bridgejob ine2e.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-jobpull-requests: writeoverride keeps workflow-level perms atread-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 locallynode mcp-bridge/tests/path_claims_bench.js→ completes in ~3s, stable outputpython3 -c "import yaml; yaml.safe_load(open('.github/workflows/e2e.yml'))"→ valid YAMLbench-bridgejob; sticky comment appears with numbers🤖 Generated with Claude Code
Generated by Claude Code