Skip to content

refactor(agents): one toolset source, one nudge runtime, one lifecycle projection - #1439

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-10669-agentdirector-consolidation-one-definition-one
Oct 16, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-10669-agentdirector-consolidation-one-definition-one

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • One source for the ten workspace toolset files (they were literal copies of the canonical constants — the copies' own headers admitted it); they import src/agent/directors/tool-sets.ts now.
  • Deletes the ten agents/<id>/src/agent.ts wrapper files: they exported {agent, defineAgent} with zero production importers (definitions are built at runtime in assemble-runtime.ts / run.ts through @intx/agent); the wrappers were the third copy of the truth. Twenty-two allowlist rows dropped in step, and the knip test's live assertion is updated to pin that agent no longer surfaces in the production scan (the worktree test-laundering disclosure block is preserved intact).
  • ChatDirector + SubAgentDirector now share one director-core.ts nudge/ephemeral-turn/composed-prompt runtime instead of two near-identical implementations.
  • The stop-policy deprecated input shadow (incompleteReportNudgeFired) is removed; callers/tests write through the cycle counter (toolLessNarrationCycles).
  • One lifecycle projection (subagent/lifecycle.ts isRunEligible) replaces five inline pending_init || running copies across agent-fleet/session-store (the fifth surfaced in review; folded).
  • The vendored live-tool-dispatch shim is kept — the vendored agent still snapshots its tool map at construction, so the deletion gate was not met (evidence in-tree); run-consume-stream.ts does not exist at this base.
  • qa-lead gets the same package-shape drift test as its six siblings at this base.
  • Step-grant/workspace-policy separation and per-director prompt data are untouched.

Verification

  • bun run check exit 0: 8,970 pass / 0 fail across 583 files; dead-export guard 331 findings / 331 allowlisted / 0 violations (dual-scan, floor 1240).
  • Independent review verified: every allowlist deletion row corresponds to a deleted export with no orphaned rows; DIRECTOR_REGISTRY fan-in unchanged (registry.ts byte-untouched, no new barrel); nudge/composed-prompt parity diff-verified across both directors; isRunEligible projection matched the five pre-existing conditions modulo their guards; qa-lead drift test asserts package shape + registry identity.

Fixes CL-10669

@linear-code

linear-code Bot commented Oct 14, 2026

Copy link
Copy Markdown

CL-10669

@corbits-triage

corbits-triage Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Fail

@TheGreatAxios, please address the following:

  • pull request is over the files limit: 51 files (max 25)

@TheGreatAxios
TheGreatAxios changed the base branch from cl-10664-provider-de-dupe-error-reader-adapter-decorators-s to main October 15, 2026 22:46
…e projection

The ten workspace toolset files were literal copies of the canonical
tool-sets constants; they import them now. The agents' agent.ts
wrappers defined zero-importer factories that the runtime never
consumed (definitions are built in assemble-runtime / run.ts through
@intx/agent); they are gone along with their re-exports and the stale
allowlist rows for those wrappers. ChatDirector and SubAgentDirector
share a single director-core nudge module instead of carrying two
withEphemeralNudge implementations, stop-policy loses its deprecated
input shadow, and lifecycle state checks fold into one isRunEligible
projection. The qa-lead outlier gets the same package-shape drift test
as the other directors. The live-tool-dispatch shim stays: the vendored
agent still snapshots its tool map at construction, so the shim is
load-bearing.

Deleting those modules drops the dead-export scan from 1366 to 1358
files, so the fail-closed floor follows. Family tool names,
approve_worker_call, auth helpers, and the provider de-dupe stay.

Step-grant/workspace-policy separation and per-director prompt data are
untouched.
@TheGreatAxios
TheGreatAxios force-pushed the cl-10669-agentdirector-consolidation-one-definition-one branch from 5c07307 to 9760666 Compare October 16, 2026 04:04
@TheGreatAxios
TheGreatAxios merged commit 28cb2a9 into main Oct 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant