Agentic AI Atlasby a5c.ai
OverviewWikiGraphFor AgentsEdgesSearchWorkspace
/
GitHubDocsDiscord
iiRecord
Agentic AI Atlas · Hardcoded Harness/Target Gaps — Should Be Derived from Atlas Graph
page:docs-hard-coded-and-should-be-in-graph-gaps-backloga5c.ai
Search record views/
Record · tabs

Available views

II.Record viewspp. 1 - 1
overviewarticlejsongraph
II.
Page JSON

page:docs-hard-coded-and-should-be-in-graph-gaps-backlog

Structured · live

Hardcoded Harness/Target Gaps — Should Be Derived from Atlas Graph json

Inspect the normalized record payload exactly as the atlas UI reads it.

File · wiki/docs/hard-coded-and-should-be-in-graph-gaps-backlog.mdCluster · wiki
Record JSON
{
  "id": "page:docs-hard-coded-and-should-be-in-graph-gaps-backlog",
  "_kind": "Page",
  "_file": "wiki/docs/hard-coded-and-should-be-in-graph-gaps-backlog.md",
  "_cluster": "wiki",
  "attributes": {
    "nodeKind": "Page",
    "sourcePath": "docs/hard-coded-and-should-be-in-graph-gaps-backlog.md",
    "sourceKind": "repo-docs",
    "title": "Hardcoded Harness/Target Gaps — Should Be Derived from Atlas Graph",
    "displayName": "Hardcoded Harness/Target Gaps — Should Be Derived from Atlas Graph",
    "slug": "docs/hard-coded-and-should-be-in-graph-gaps-backlog",
    "articlePath": "wiki/docs/hard-coded-and-should-be-in-graph-gaps-backlog.md",
    "article": "\n# Hardcoded Harness/Target Gaps — Should Be Derived from Atlas Graph\n\n> All data should flow: **Atlas graph → agent-catalog (bridge) → consumer packages**\n>\n> Updated 2026-05-07. No backward compatibility — fix forward only.\n\n## Audit Summary\n\n**Total hardcoded harness-specific literals in production code: ~201**\n(excludes test infrastructure in harness-mock: 55 refs)\n\n| Category | Count | Package | Severity |\n|----------|-------|---------|----------|\n| Adapter self-identity defaults | 38 | adapters/adapters | High |\n| Adapter self-registration calls | 10 | adapters/adapters | High |\n| hooks-adapter adapter defaults + fallbacks | 40 | hooks-adapter/adapter-* | High |\n| Dispatch switches (translate/launch/tui) | 11 | adapters/adapters + cli | Medium |\n| Adapter class→format maps | 9 | extensions-adapter | Medium |\n| SDK prompt context factory names | 9 | sdk/harness | Medium |\n| CLI paths/capabilities | 5 | adapters/cli | Medium |\n| Model/host-detection registries | 6 | adapters/core | Medium |\n| adapters CJS process scripts | 18 | adapters/processes | Low |\n| Test mock scenarios | 55 | adapters/harness-mock | Low |\n\n---\n\n## HIGH: Adapter Identity & Registration (88 refs)\n\n### H1 — adapters adapter self-identity (38 refs)\n\nEach adapter class hardcodes its own `agent` and `cliCommand`:\n```typescript\nreadonly agent: string = 'claude';\nreadonly cliCommand: string = 'claude';\n```\n\n**Files:** claude-adapter.ts, codex-adapter.ts, cursor-adapter.ts, gemini-adapter.ts, copilot-adapter.ts, pi-adapter.ts, pi-sdk-adapter.ts, omp-adapter.ts, opencode-adapter.ts, opencode-http-adapter.ts, openclaw-adapter.ts, droid-adapter.ts, amp-adapter.ts, hermes-adapter.ts, qwen-adapter.ts, codex-sdk-adapter.ts, codex-websocket-adapter.ts, claude-agent-sdk-adapter.ts, claude-remote-control-adapter.ts, babysitter-adapter.ts, adapters-remote-adapter.ts\n\n**Fix:** Constructor injection. Each adapter accepts `agent` and `cliCommand` as constructor params. The self-registration call provides these from the catalog:\n```typescript\nconst target = getPluginTargetDescriptor('claude-code');\nregisterAdapterFactory(target.adapterName, () => new ClaudeAdapter(target.adapterName, target.cliCommand));\n```\n\n**Atlas data needed:** Already available — `adapterName` and `cliCommand` on PluginTarget.\n\n### H2 — adapters self-registration calls (10 refs)\n\n```typescript\nregisterAdapterFactory('claude', () => new ClaudeAdapter());\n```\n\n**Fix:** Read the adapter name from the catalog or from the `adapterModule` field that already exists in Atlas. The barrel import in index.ts triggers registrations.\n\n### H3 — hooks-adapter adapter defaults + fallbacks (40 refs)\n\nEach hooks-adapter adapter has:\n- `createAdapter(name = 'claude')` — default name literal\n- `ADAPTER_NAME = 'codex'` — const in normalizers\n- `_adapterName = 'claude'` — mutable default\n- `adapter: 'claude'` — in fallback mapping arrays\n\n**Files:** All 9 adapter-*/src/ packages (adapter.ts, normalizer.ts, mappings.ts, integration.ts)\n\n**Fix:** Remove ALL defaults. The adapter-loader in hooks-adapter-cli MUST pass the name from the catalog. If catalog is unavailable, fail explicitly rather than silently using a wrong default.\n\n**Atlas data needed:** Already available — `adapterName` on PluginTarget.\n\n---\n\n## MEDIUM: Dispatch & Registry Maps (40 refs)\n\n### M1 — translateForHarness switch (8 refs)\n\n```typescript\nswitch (agent) {\n  case 'claude': return translateForClaude(config);\n  case 'codex': return translateForCodex(config);\n  ...\n}\n```\n\n**File:** packages/adapters/adapters/src/translate-for-harness.ts\n\n**Fix:** Each translation function self-registers in a `TRANSLATION_REGISTRY` map at import time (same pattern as adapter self-registration). The switch becomes a map lookup. Add `translationStrategy` field to Atlas PluginTarget if needed for grouping (e.g., codex-sdk uses the same translation as codex).\n\n### M2 — CLI launch/tui routing (5 refs)\n\n```typescript\ncase 'codex': ...\ncase 'gemini': ...\n```\n\n**Files:** packages/adapters/cli/src/commands/launch.ts, tui.ts, remote.ts\n\n**Fix:** Launch config comes from catalog. Each agent's launch behavior is an Atlas attribute (`launchMode: 'cli-spawn' | 'sdk-connect' | 'websocket'`).\n\n### M3 — extensions-adapter adapter class→format maps (9 refs)\n\n```typescript\nconst ADAPTER_CLASS_BY_FORMAT = {\n  'claude-code': ClaudeCodeAdapter,\n  'codex': CodexAdapter,\n  ...\n};\n```\n\n**File:** packages/extensions-adapter/src/targets/adapters/index.ts\n\n**Fix:** Self-registration pattern. Each adapter class registers itself by hookRegistrationFormat at import time. The index.ts barrel import triggers all registrations.\n\n### M4 — SDK prompt context factory names (9 refs)\n\n```typescript\nexport function createCodexContext(overrides?) { ... }\nexport function createCursorContext(overrides?) { ... }\n```\n\n**File:** packages/babysitter-sdk/src/harness/hooks/promptContexts.ts\n\n**Fix:** Already partially addressed — `createPromptContextFromCatalog()` exists. Remove the named factory functions entirely. Callers should use `createPromptContextFromCatalog(targetId)`.\n\n### M5 — adapters core registries (6 refs)\n\n- `model-registry.ts` — per-agent default model mappings\n- `host-detection.ts` — host detection signals\n- `builtin-hooks.ts` — built-in hook handlers\n- `spawn-runner-utils.ts` — spawn configuration\n\n**Fix:** Model registries and host detection should come from Atlas AgentVersion/PluginTarget records. Add `defaultModelId`, `spawnConfig` fields to Atlas.\n\n### M6 — adapters CLI paths/capabilities (5 refs)\n\n- `agent-subagent-paths.ts` — per-agent subagent path resolution\n- `agent-skill-paths.ts` — per-agent skill path resolution\n- `agent-capabilities.ts` — per-agent capability declarations\n\n**Fix:** Path resolution and capabilities from catalog. These are PluginTarget `installLayout` and `capabilities` fields.\n\n---\n\n## LOW: Scripts & Test Infrastructure (73 refs)\n\n### L1 — adapters CJS process scripts (18 refs)\n\n```\nfix-enums.cjs, fix-enums2.cjs, fix-capabilities.cjs, fix-adapters.cjs,\nfix-adapters-mcp.cjs, execute-advanced-uis-playbook.mjs, etc.\n```\n\n**Fix:** These are one-shot migration/fix scripts. They can hardcode names because they're ephemeral tooling, not runtime code. However, they should be cleaned up or deleted if no longer needed.\n\n### L2 — harness-mock test scenarios (55 refs)\n\n```\nper-agent.ts, probe.ts, types.ts, scenarios.ts, hooks.ts, errors.ts, interactive.ts\n```\n\n**Fix:** Test infrastructure that creates mock scenarios per agent. Could be generated from catalog but low priority — tests validating specific agent behavior reasonably hardcode the agent name.\n\n---\n\n## Atlas Schema Gaps (fields needed but not yet added)\n\n| Field | Node Kind | Purpose | Used By |\n|-------|-----------|---------|---------|\n| `translationStrategy` | PluginTarget | Groups agents sharing translation logic | translate-for-harness.ts |\n| `launchMode` | PluginTarget | CLI launch behavior (cli-spawn/sdk/ws) | launch.ts |\n| `defaultModelId` | AgentVersion | Default AI model per agent | model-registry.ts |\n| `spawnConfig` | PluginTarget | CLI spawn arguments and env | spawn-runner-utils.ts |\n| `subagentPaths` | PluginTarget | Subagent discovery paths | agent-subagent-paths.ts |\n| `skillPaths` | PluginTarget | Skill discovery paths | agent-skill-paths.ts |\n\n---\n\n## Completed Items (from previous work)\n\n| What | Status |\n|------|--------|\n| P1: Master target registries (buildPluginTargetDescriptors, SDK discovery specs, deriveProcessNames, adapter registry) | ✅ |\n| P2: Type definitions (HookRegistrationFormat, HARNESS_ALIASES) | ✅ |\n| P3: Special cases (openclaw Stop, codex marketplace, copilot bin scripts, oh-my-pi adapter) | ✅ |\n| P4: Env vars / install paths | ✅ |\n| P5.4: BuiltInAgentName | ✅ |\n| P6: Scripts/CI (sync-external, docs freshness, architecture) | ✅ |\n| Prompt contexts (capabilityCollector, compose, criticalRules, runCreation, taskKinds) | ✅ |\n| Provider support matrix | ✅ |\n| hooks-adapter adapter capabilities → Atlas (11 fields) | ✅ |\n| hooks-adapter phase mappings → Atlas (4 fields on HookMapping) | ✅ |\n| Pattern C: self-registering adapters adapters | ✅ |\n| 329 harness name literals → parameterized | ✅ |\n| agent-catalog: pure Atlas wrapper (no graph/, evidence/, assets.ts) | ✅ |\n| packages/catalog removed | ✅ |\n",
    "documents": []
  },
  "outgoingEdges": [],
  "incomingEdges": [
    {
      "from": "page:docs",
      "to": "page:docs-hard-coded-and-should-be-in-graph-gaps-backlog",
      "kind": "contains_page"
    }
  ]
}

Shortcuts

Back to overview
Open graph tab