Skip to content

feat(agents): resolve C-1 agent-name collision with AI Factory (KEEP-AIF / skill-context / rename) - #80

Closed
artyhoo wants to merge 1 commit into
mainfrom
feat/agent-collision-resolution
Closed

feat(agents): resolve C-1 agent-name collision with AI Factory (KEEP-AIF / skill-context / rename)#80
artyhoo wants to merge 1 commit into
mainfrom
feat/agent-collision-resolution

Conversation

@artyhoo

@artyhoo artyhoo commented May 20, 2026

Copy link
Copy Markdown
Owner

Summary

Resolves the C-1 agent-name collision with AI Factory (AIF v2.11.0), which ships three sub-agents whose filenames collide with ours (best-practices-sidecar, docs-auditor, review-sidecar). Default install silently let AIF's thin stubs win; --force would strip AIF frontmatter its pipeline depends on. The accepted resolution (per research-patch) treats the three non-uniformly so our install occupies zero of AIF's agent slots — adopting AIF where it already covers the job, riding AIF's native skill-context override where our content is unique, and renaming where the job genuinely differs.

Changes

  • best-practices-sidecar → KEEP-AIF (ADOPT): excluded from the install glob (install.sh:235-241); removed from extension.json + REQUIRED_HEADER_DOCS. AIF's own rules-sidecar already reads .ai-factory/RULES.md; our edit-time ESLint + pre-push are the earlier-channel enforcers. Its only residue with no earlier channel (R10 naming, R4/R17 test-existence) ships via a new aif-rules-check skill-context override. The file is kept in-repo as portable SSOT (not deleted).
  • review-sidecar → PRESERVE via skill-context (ADAPT): anti-tautology content delivered into AIF's aif-review pipeline via packages/core/templates/shared/skill-context/aif-review/SKILL.md; agents/review-sidecar.md kept as portable SSOT with @dual-pair/spec-of markers (review-sidecar.md:12).
  • docs-auditor → RENAME to living-docs-auditor (KEEP-NARROW): distinct job from AIF's docs-auditor (backward Living-Docs drift via audit-ai-docs.sh vs forward /aif-docs generation gating).
  • New SSOT entry #50 — "skill-context = AIF-native vendored-agent override", verdict ADOPT.
  • Doc-prose honesty sweep across README, INSTALL, INSTALL-FOR-AI, setup.sh, RULES*.md, skills/references/* + the two .claude/rules citation lists + CLAUDE.md ownership row, to match the new shipped set. Frozen/historical docs (docs/audits/**, closed-questions, open-questions, self-application, retros, research-patches) deliberately untouched.

Note: the load-bearing claim — does a background:true, maxTurns:6 sidecar actually read+apply skill-context? — was verified by a live headless probe before this PR (3/3 read, 2/2 apply with legitimately-phrased conventions; injection-shaped text correctly refused). So the skill-context path is confirmed, not assumed; the MERGE fallback is not needed.

Prior-art consult

  • Capability commit carries a Prior-art: trailer citing prior-art-evaluations.md#50.
  • New capability area surfaced → SSOT entry chore(deps): bump js-yaml and markdownlint-cli2 #50 added in the same commit with Verdict / Rationale / Trigger.
  • No existing entries needed Last reviewed bump.
  • Research used DeepWiki + live probe + CC docs (no context7 needed — this is a CC/AIF-internals adoption, evidence in the research-patch §2-§6).

Test plan

  • npm run --prefix packages/core test:principles green (81 pass / 4 skip) — incl. principle 09 (REQUIRED_HEADER_DOCS ↔ install.sh SHIPPED_DOCS set-equality, length → 15) and principle 11 (capability/SSOT enforcement).
  • Full core suite: 47/48 files pass; the 1 fail is validate-batch-spec soft-mode timing out on gh (environmental sandbox, gh-dependent — unrelated; CI has gh).
  • npm run typecheck clean; npm run check:skill-drift PASS (0 broken refs, all frontmatter present).
  • markdownlint-cli2 clean on all staged .md (pre-commit hook).

§1.7 Forward-check applied

Checked the resolution against every relevant existing discipline:

  • build-first-reuse-default verdict typology (build-first-reuse-default.md:22, :25) — each agent got an explicit ADOPT / ADAPT / KEEP-NARROW verdict with a T16 problem-class match.
  • dual-implementation-discipline §5/§7 (dual-implementation-discipline.md:115) — review-sidecar + best-practices-residue treated as one-SSOT-two-channels, bound by @dual-pair/spec-of markers (review-sidecar.md:12, best-practices-sidecar.md:12).
  • doc-authority-hierarchy §2 — both new shipped skill-context templates carry Authoritative-for headers and were added to REQUIRED_HEADER_DOCS (09-doc-authority-hierarchy.ts:93).
  • no-paid-llm-in-ci — the version-bump safety check is deterministic comm/grep (research-patch §5.3); the live probe ran on the operator's subscription, not paid API.

§1.7 Backward-check applied

Swept the complete existing surface, not examples:

  • grep -rn for all three agent names across the repo → enumerated ~16 live files + the frozen set; updated every non-frozen reference and verified grep for stray docs-auditor (our agent) outside frozen returns empty.
  • Principle 09's install.sh↔REQUIRED_HEADER_DOCS set-equality test re-run green after the length change (09-doc-authority-hierarchy.test.ts:164).
  • Confirmed AIF's install ships agents via a glob, not the SHIPPED_DOCS array — so KEEP-AIF required a glob exclusion, not just an array edit (install.sh:240).

Three of our shipped sub-agents collided by filename with AIF's vendored
agents (best-practices-sidecar, docs-auditor, review-sidecar). Resolve
non-uniformly so our install occupies ZERO of AIF's agent slots:

- best-practices-sidecar -> KEEP-AIF: no longer shipped (excluded from the
  install glob). AIF's own rules-sidecar reads .ai-factory/RULES.md; our
  edit-time ESLint + pre-push are the earlier-channel enforcers. The only
  residue with no earlier channel (R10 naming, R4/R17 test-existence) ships
  via the new aif-rules-check skill-context override. File kept as portable SSOT.
- review-sidecar -> PRESERVE via skill-context: anti-tautology content
  delivered into AIF's aif-review pipeline via skill-context override;
  agents/review-sidecar.md kept as portable SSOT (@dual-pair/spec-of markers).
- docs-auditor -> RENAME to living-docs-auditor: distinct job from AIF's
  docs-auditor (backward Living-Docs drift vs forward /aif-docs gen gating).

Verified live (research-patch section 2 / W6): a background maxTurns:6 sidecar
reads + applies skill-context (3/3 read, 2/2 apply). Doc prose across README,
INSTALL*, RULES*, skills/* updated to match the new shipped set. Principle 09
REQUIRED_HEADER_DOCS + install.sh SHIPPED_DOCS kept in sync (length -> 15).
Also: add language to 3 pre-existing unlabeled fenced blocks in touched
skills/references files (markdownlint MD040, required to land the staged rename).

Prior-art: prior-art-evaluations.md#50 (skill-context as AIF-native vendored-agent override, verdict ADOPT — the mechanism adopted to deliver our content without occupying AIF agent slots). Detail: docs/meta-factory/research-patches/2026-05-20-agent-collision-resolution.md
@artyhoo

artyhoo commented May 20, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #82. PR #79 (merged in parallel) already landed the overlap (KEEP-AIF best-practices + RENAME docs-auditor→living-docs-auditor + prose sweep); #80 conflicted by redoing it. #82 is the clean delta-only follow-up off current main — the skill-context delivery + SSOT #50 that #79 explicitly deferred pending the live probe (which has now run: 3/3 read, 2/2 apply). Best-practices file: accepted #79's deletion; residue preserved via aif-rules-check skill-context.

@artyhoo artyhoo closed this May 20, 2026
artyhoo added a commit that referenced this pull request May 20, 2026
…-1 follow-up) (#82)

Follow-up to #79, which resolved C-1 (KEEP-AIF best-practices + RENAME
docs-auditor->living-docs-auditor) and explicitly deferred this skill-context
delivery pending a live probe.

The probe ran: a background:true maxTurns:6 AIF sidecar reads + applies
.ai-factory/skill-context/<skill>/SKILL.md (3/3 read, 2/2 apply with
legitimately-phrased conventions; injection-shaped text correctly refused).
So we ship the deferred delivery:

- skill-context/aif-review/SKILL.md — our anti-tautology two-AI test review,
  injected into AIF's review-sidecar (@dual-pair with agents/review-sidecar.md,
  the portable SSOT).
- skill-context/aif-rules-check/SKILL.md — the R10-naming + R4/R17 test-existence
  residue of the removed best-practices-sidecar (the only checks with no earlier
  deterministic channel), injected into AIF's rules-sidecar. Self-contained.

install.sh ships both to .ai-factory/skill-context/; both formalized in
principle 09 REQUIRED_HEADER_DOCS + install.sh SHIPPED_DOCS (length 13->15).
Net: zero AIF agent slots occupied. Supersedes PR #80 (which conflicted with #79
by redoing the overlap); this is the clean delta only.

Prior-art: prior-art-evaluations.md#50 (skill-context as AIF-native vendored-agent override, verdict ADOPT). Detail: docs/meta-factory/research-patches/2026-05-20-agent-collision-resolution.md
@artyhoo
artyhoo deleted the feat/agent-collision-resolution branch May 20, 2026 22:52
artyhoo added a commit that referenced this pull request May 29, 2026
…eep evaluation (#268)

Variant scored: MCP-consumer bridge (handoff_create_task + accept_existing_plan +
WebSocket tail + handoff_sync_status). 7 DeepWiki probes + 2 WebSearch queries +
SSOT #27/#28/#30/#43/#44/#46/#67/#80 consult + SKILL.md:404/429 disambiguation.

Verdict: REFERENCE (not ADOPT). Body-format falsifier PASSES — description field
accepts arbitrary markdown (z.string().optional(), no .max()). Minimum call =
{projectId, title}. BUT full pipeline bridge blocked by three structural issues:
(1) accept_existing_plan requires physical PLAN.md on disk in .ai-factory/ —
filesystem coupling beyond MCP boundary; (2) WebSocket broadcast channel has no
topic filter — client must filter by taskId; (3) aif-handoff Reviewer (autoMode)
conflicts with reviewer-discipline.md §2 strategy-fork-surface gate.

Admission gate §2.4: PR #127/#128 touch packages/runtime/ only — no packages/mcp/
or apps/coordinator/ changes. Gate CLEAR.

SKILL.md:404 vs :429 inconsistency resolved analytically (both consistent — BFR
verdict = REFERENCE for SP skill; operational action = ADOPT SP dispatch template).

Prior-art: prior-art-evaluations.md#44 (DEFER, body-format now confirmed compatible);
prior-art-evaluations.md#30 (DEFER, accept_existing_plan bypass documented);
prior-art-evaluations.md#67 (REJECT unchanged — Variant A is optional layer, not
replacement). Sub-wave D proposes new SSOT row for Variant A bridge vocabulary.
artyhoo added a commit that referenced this pull request May 29, 2026
…k + aif-handoff MCP) REFERENCE (#275)

Verdict per BFR-default §1: REFERENCE — design-vocabulary for dispatch-trigger
optimisation of Variant A; not actionable standalone.

Key findings (2026-05-29 evidence):
- CC PostToolUse hooks expose a purpose-built `mcp_tool` hook type for
  already-connected MCP servers (code.claude.com/docs/en/hooks.md fetched
  2026-05-29) — T-AIF-BRIDGE-B'-1 evades via different shape than originally
  framed.
- aif-handoff MCP server runs standalone without coordinator daemon for task
  creation (DeepWiki ×2 phrasings: «MCP server can be invoked statelessly from
  an arbitrary process» + «MCP HTTP daemon runs independently») —
  T-AIF-BRIDGE-B'-3 evades.
- 4 sub-options each fit <100 LOC bridge target: Option (a') = 0 LOC bash
  (mcp_tool hook config), Option (a) = ~25 LOC bash (command hook + curl),
  Option (b) = ~15 LOC chokidar Node, Option (c) = ~10 LOC fswatch bash.

BUT: B' inherits all 3 of SW-A's ADOPT-blockers verbatim (PLAN.md disk coupling,
WebSocket-broadcast no-topic-filter, autoMode Reviewer vs reviewer-discipline.md
§2 conflict — DN-1=B-constrained applies). B' optimises only the dispatch
trigger; the load-bearing blockers persist. Comparison table vs A and B in §6.

§4 5-criteria: PASS-PASS-PARTIAL-PASS-INHERITED. Match ~35%. Atomicity
INCONCLUSIVE/MITIGABLE (chokidar awaitWriteFinish for Option b; empirical for
hooks).

Falsifier: B' upgrades to ADOPT VOCABULARY iff Sub-wave D greenlights A AND
DN-1=B-constrained adopted.

T-discipline applied per kickoff §6 SW-B2: T1 / T3 / T7 / T11 / T12 / T13 / T15
/ T16 / T17 / T19 (own cold-QA before push) / T20 + T-AIF-BRIDGE-B'-1..5.

Prior-art: SSOT #20 (CC hooks API, ADOPT) + SSOT #27/#28/#30/#43/#44/#46/#67/#80
(aif-handoff rows). Additive note to SSOT #44 proposed (no verdict change).
Proposed new SSOT row at next-available slot #85.
artyhoo added a commit that referenced this pull request May 29, 2026
… Implementer-equivalent only) value-add audit (#276)

R-phase patch for Sub-wave C of the aif-handoff-as-runtime-bridge umbrella.
Evaluates Variant C (kickoff §3 lines 124-145): aif-handoff as Implementer-
equivalent only, bypass Planner+Reviewer cycle, thin CLI wrapper for kickoff
dispatch + kanban status tracking.

Verdict: REJECT (BFR-default §1 ladder). Rationale:
- The kickoff-framed "aif-handoff exec --kickoff <path>" CLI does not exist
  in lee-to/aif-handoff (DeepWiki probes 1+5, 2026-05-29).
- No first-class Implementer-only mode; skipReview:true bypasses Reviewer but
  Planner is mandatory unless accept_existing_plan with on-disk PLAN.md
  (same disk coupling SW-A flagged for Variant A).
- BEFORE/AFTER maintainer-action count: 25% literal / 0% cognitive reduction
  (T-AIF-BRIDGE-C table §4) — below kickoff §8 STOP 30% threshold → verdict
  "Variant C value-add insufficient".
- Pure-tracker pattern (paused:true + autoMode:false + manual state-machine
  transitions) IS shipped but adds zero automation beyond UI tracking;
  Docker+SQLite infra unjustified.

Cites:
- SW-A merged PR #268 (Variant A REFERENCE, 28% match, 3 ADOPT-blockers)
- SW-B merged PR #267 (Variant B REJECT, ~5% match, no dir-watch capability)
- PR #269 follow-up (mechanical corrections, no verdict changes)
- DN-1=B-constrained input consumed in criterion 5 (mooted for Variant C
  which bypasses aif-handoff Reviewer entirely)
- Gate-4 admission re-sweep: PR #127+#128 touch packages/runtime/ only
  (no MCP/coordinator drift in 30-day window)

5 distinct DeepWiki probes + 2 WebSearches + cross-ref to SW-A/SW-B/PR #269
= 19+ evidence channels (T1 floor exceeded 3.8x). §1.7 forward+backward +
§self-application + T-trap walk per ai-laziness-traps.md §3.

Single output file under docs/meta-factory/research-patches/. No code, skill,
agent, install.sh, or .claude/rules/ modifications.

### §1.7 Forward-check applied

build-first-reuse-default.md §1 verdict ladder applied; BFR §3 6-layer search
performed (SSOT rows #27/#28/#29/#30/#43/#44/#46/#67/#80 reviewed at
prior-art-evaluations.md:95-148; DeepWiki >=5 probes; WebSearch >=2 phrasings;
own-stack sweep at .claude/skills/meta-orchestrator/SKILL.md:441 anti-scope +
:404+:429 SP requesting-code-review). no-paid-llm-in-ci.md §1 enforced (all
evidence via subscription-bundled DeepWiki/WebSearch + free gh CLI + bash).
reviewer-discipline.md §2 respected (DN-1=B-constrained consumed as fact, not
re-litigated; verdict is research finding against §8 STOP, not strategy
choice). ai-laziness-traps.md §3 active T-traps applied (T1, T3, T7, T11,
T12, T13, T15, T16, T17, T19, T20, T-AIF-BRIDGE-C MANDATORY BEFORE/AFTER
table at patch §4). Evidence: see patch §8 file:line citations.

### §1.7 Backward-check applied

SSOT #27/#28/#67 receive additive notes (additive-only; no verdict changes).
Original DEFER/DEFER/REJECT rationales reviewed at prior-art-evaluations.md:
95, 96, 135 — consistent with Sub-wave C findings (reinforce existing
classifications, do not re-litigate). No .claude/rules/* modified; no
.claude/skills/* modified; no agents/* modified; no packages/* modified;
no install.sh modified; no kickoff.md modified. Single output file in
docs/meta-factory/research-patches/. Scope strictly bounded to Variant C;
SW-A/SW-B/SW-B2/SW-D out of scope. T15 self-application confirmed in
patch §10. Memory not written (Sub-wave D synthesis is the natural
codification surface). Evidence: see patch §9 file:line citations.
artyhoo added a commit that referenced this pull request May 29, 2026
…verdict (DEFER-all-with-updated-triggers) (#281)

Cross-variant synthesis consolidating Sub-waves A/B/B'/C (merged PRs #267/#268/#275/#276). Per-variant verdicts re-derived independently per T15: A=REFERENCE (28%), B=REJECT (~5%), B'=REFERENCE conditional ADOPT VOCABULARY (~35%), C=REJECT (~22%). Cross-variant recommendation per kickoff §6.5: DEFER all variants with updated SSOT «Trigger to revisit» fields.

Includes 20-cell comparison table (4 variants × 5 criteria, file:line citation per cell), 4-row T16 problem-class match table, DN-1 (B-constrained) + DN-2 (B' is operative B-path) reflections, hook-discipline (Decision 10) analysis (no equipoise → recommend on clearly-better evidence; DECISION-NEEDED NOT warranted), consolidated SSOT additive notes for #27/#28/#30/#44/#67/#80, proposed new SSOT row #85 (next-after-#84 verified).

Prior-art: prior-art-evaluations.md#27, #28, #30, #44, #67, #80 (existing aif-handoff entries, additive-note-only — no verdict changes); SSOT row #85 PROPOSED, not landed.
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.

1 participant