mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-09 22:13:39 +09:00
ci(agentbbs): stop rule 2 firing on the federation wire namespace
ADR-164 rule 2 exists to stop `agentbbs` becoming a mandatory dependency: a
static `import ... from 'agentbbs'` is forbidden, and any other mention has to
sit behind loadAgentbbs / a dynamic import. Its catch-all is a substring test
for "agentbbs" anywhere in the file.
agentbbs-federation.ts trips that catch-all without importing anything. Its
only remaining mentions after comment-stripping are string literals that never
reach a module resolver: the '/agentbbs/v1/...' HTTP route prefix and the
'agentbbs:<kind>:' hash domain-separators.
Adds those two shapes to the existing benign-pattern strip list. The
static-import check is untouched and remains the real gate.
Verified this narrows the check rather than loosening it, by running the
workflow's own rule-2 body verbatim against fixtures:
- the real federation module -> passes (false positive gone)
- `import { x } from 'agentbbs'` -> still caught
- unguarded runtime reference -> still caught
- guarded `await import('agentbbs')` -> passes
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_013u4pmL9ZUAXb6usVQgNo67
This commit is contained in:
1 parent
2376435f84
commit
fda44cd1f4
1 file changed
+10
-1
@@ -122,7 +122,16 @@ jobs:
|
|||||||
.replace(/\/\*[\s\S]*?\*\//g, '') // block comments
|
.replace(/\/\*[\s\S]*?\*\//g, '') // block comments
|
||||||
.replace(/export\s+\{[^}]*agentbbsTools[^}]*\}\s+from\s+['\"][^'\"]+agentbbs-tools[^'\"]*['\"];?/g, '')
|
.replace(/export\s+\{[^}]*agentbbsTools[^}]*\}\s+from\s+['\"][^'\"]+agentbbs-tools[^'\"]*['\"];?/g, '')
|
||||||
.replace(/import\s+\{[^}]*agentbbsTools[^}]*\}\s+from\s+['\"][^'\"]+agentbbs-tools[^'\"]*['\"];?/g, '')
|
.replace(/import\s+\{[^}]*agentbbsTools[^}]*\}\s+from\s+['\"][^'\"]+agentbbs-tools[^'\"]*['\"];?/g, '')
|
||||||
.replace(/\.\.\.agentbbsTools,?/g, '');
|
.replace(/\.\.\.agentbbsTools,?/g, '')
|
||||||
|
// Phase 2 federation uses 'agentbbs' as a wire namespace, not a
|
||||||
|
// package: the '/agentbbs/v1/...' HTTP route prefix and the
|
||||||
|
// 'agentbbs:<kind>:' hash domain-separators. Neither loads the
|
||||||
|
// optional dependency, so neither needs a loadAgentbbs guard.
|
||||||
|
// The static-import check above is untouched and still the
|
||||||
|
// real gate — this only stops the catch-all heuristic firing
|
||||||
|
// on string literals that never reach a module resolver.
|
||||||
|
.replace(/agentbbs(?=\\?\/v1)/g, '')
|
||||||
|
.replace(/agentbbs(?=:[a-z]+:)/g, '');
|
||||||
if (/agentbbs/.test(stripped)) {
|
if (/agentbbs/.test(stripped)) {
|
||||||
const guarded = /loadAgentbbs|import\(['\"]agentbbs['\"]\)/m.test(src);
|
const guarded = /loadAgentbbs|import\(['\"]agentbbs['\"]\)/m.test(src);
|
||||||
if (!guarded) {
|
if (!guarded) {
|
||||||
|
|||||||
Reference in new issue
Block a user