diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6c4fd865..07278c741 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,7 +178,7 @@ jobs: contents: write strategy: fail-fast: false - # Four marketplace plus six flat — opencode and kilo are flat-only. Mirrors the CLI golden + # Four marketplace plus seven flat — opencode, kilo and antigravity are flat-only. Mirrors the CLI golden # snapshot matrix. matrix: include: @@ -192,6 +192,7 @@ jobs: - { tool: codex, mode: flat } - { tool: opencode, mode: flat } - { tool: kilo, mode: flat } + - { tool: antigravity, mode: flat } steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/README.md b/README.md index 87e15899c..3ea77aa35 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ https://github.com/user-attachments/assets/92474f4c-053a-471d-9c62-16560b7a2a09 GitHub Copilot✅✅✅ OpenCode✅—✅ Kilo Code✅—✅ -Codex✅✅✅ +Codex✅✅✅ +Antigravity CLI✅—✅ diff --git a/aidd_docs/tasks/2026_10/2026_10_02_antigravity-flat-host/backlog-link.json b/aidd_docs/tasks/2026_10/2026_10_02_antigravity-flat-host/backlog-link.json new file mode 100644 index 000000000..6f955dffc --- /dev/null +++ b/aidd_docs/tasks/2026_10/2026_10_02_antigravity-flat-host/backlog-link.json @@ -0,0 +1,5 @@ +{ + "backlog": "ai-driven-dev/framework#511", + "written_at": "2026-10-02T16:30:00Z", + "written_by": "aidd-dev:01-plan" +} diff --git a/aidd_docs/tasks/2026_10/2026_10_02_antigravity-flat-host/phase-2.md b/aidd_docs/tasks/2026_10/2026_10_02_antigravity-flat-host/phase-2.md new file mode 100644 index 000000000..3739aca29 --- /dev/null +++ b/aidd_docs/tasks/2026_10/2026_10_02_antigravity-flat-host/phase-2.md @@ -0,0 +1,117 @@ +--- +status: done +--- + + + +# Instruction: `antigravity` profile with skills, registered everywhere, golden cell + +## Architecture projection + +> Tree of the final files. ✅ create · ✏️ modify · ❌ delete + +```txt +cli/ +├── src/kernel/tool.ts ✏️ AiToolId union and AI_TOOL_IDS +├── src/contexts/framework/application/framework/translator/built-tree-materialization-translator.ts ✏️ recognise a skill at the profile's declared flat layout, not only `skills//…` +├── src/contexts/tools/domain/profiles/antigravity/ +│ ├── antigravity-paths.ts ✅ `.agents/` directory and skills dir constants +│ ├── profile.ts ✅ AiTool, flat plugins, no hooks yet, registerTool +│ └── build.ts ✅ flat contract: skills only, agents/hooks/mcp/rules/commands unsupported +├── src/runtime/wiring/{tools,framework,translate}.ts ✏️ side-effect profile import +├── src/runtime/assets/asset-loader.ts ✏️ CONFIG_ASSETS entry (Record) +├── src/presentation/commands/translate.ts ✏️ `--to` help string +├── src/presentation/prompts/menu-use-case.ts ✏️ example strings +├── scripts/smoke-tools.sh ✏️ AI_TOOLS +├── scripts/check-bundle-size.mjs ✏️ only if the budget breaks, with a registry line +├── mutation-scopes.json, package.json ✏️ `tools-antigravity` scope and script +├── tests/architecture/tool-addition-cost.arch.test.ts ✏️ BASELINE counts +1 for the files above +├── tests/contexts/tools/domain/profiles/antigravity/ +│ ├── profile.unit.test.ts ✅ paths, capabilities, telemetry reason +│ └── build.unit.test.ts ✅ skill paths, link rewriting +├── tests/golden/framework-build-golden.e2e.test.ts ✏️ FLAT_TARGETS + cell count +├── tests/golden/snapshots/framework-build/golden.json ✏️ new `antigravity:flat` cell only +├── tests/golden/snapshots/{help/surface,phase0/snapshot}.json, tests/fixtures/cli-owns-read/expected-envelope.json ✏️ regenerated +└── tests/** enumerating tool ids (tool-config, registry-conformance, build-hooks-support-declaration, asset-loader, interactive-menu, translate-wiring, uninstall-use-case, build-unit-deps, telemetry-route-supply, plugin-root-token-declaration, metrics-contract, cost-report-envelope, tool-attribution, host-marketplace-registry-reader-adapter) ✏️ +.github/workflows/ci.yml ✏️ `{ tool: antigravity, mode: flat }` row, comment count +scripts/__tests__/smoke-real-user-scope-tool-list-parity.test.js ✏️ flat-only list +docs/MAINTAINERS.md ✏️ archive count +``` + +## User Journey + +```mermaid +flowchart TD + A[aidd setup --ai antigravity] --> B[skills written to .agents/skills/aidd-*/SKILL.md] + B --> C[manifest records them under antigravity] + D[aidd translate src --to antigravity --as flat] --> E[same .agents/skills tree in --out] + C --> F[aidd clean antigravity removes only its recorded files] +``` + +## Test Scope + +```mermaid +--- +title: Test scope +--- +journey + section Setup + fixture framework source with one plugin skill => source ready: 5: system + section Happy path + aidd translate fixture --to antigravity --as flat => .agents/skills/-/SKILL.md written: 5: cli + aidd setup --ai antigravity => skills under .agents/skills recorded in manifest: 5: cli + golden e2e => antigravity:flat cell matches, other cells unchanged: 5: cli + section Edge case - foreign file + user file .agents/skills/mine/SKILL.md => clean antigravity => file untouched: 5: cli + section Teardown + remove temp project => baseline restored: 5: system +``` + +## Tasks to do + +### `1)` Profile, paths and flat contract + +> Skills only; every other artifact `supported: false` until its phase. + +1. `antigravity-paths.ts`: `ANTIGRAVITY_DIRECTORY = ".agents/"`, skills dir. +2. `build.ts`: skills `fullTree`, `rewriteSkillName: true`, path `.agents/skills/-/`, one directory level (same shape as Codex flat). Measured 2026-10-05 on `agy` 1.2.14: `.agents/skills/flat-probe/SKILL.md` logs `expanded slash command "flat-probe" (skill)`; `.agents/skills/aidd-probe/nested-probe/SKILL.md` logs no expansion. Never `//`. +3. Install side: setup reads the built flat tree back through `belongsToPlugin` in `built-tree-materialization-translator.ts`, which accepts only `skills//…` and so installs 0 files from the one-level layout. Let the profile declare its flat skill layout and have the materializer recognise it; test first (red: setup installs 0 skills), keep every existing tool's behaviour unchanged. +4. `profile.ts`: `SkillsCapability` on `.agents/skills/`, `PluginsCapability` `mode: "flat"`, `acceptsHooks: false` with a reason pointing to phase 3; `telemetryLocalRead` unsupported with the canonical reason string `registry-conformance` expects; no `distributionProbes.marketplace`. +5. Unit tests first: profile and build, red then green. + +### `2)` Register the id everywhere the arch test demands + +> Kilo review lesson: a static id is not a runtime registration. + +1. `tool.ts`, three wiring files, asset loader, translate help, menu strings. +2. Raise each `tool-addition-cost` BASELINE count by one; nothing else in that file. +3. Update every test enumeration listed in the projection; regenerate help and phase0 snapshots and the cli-owns-read envelope. + +### `3)` Golden cell and CI matrix + +> Only the new cell may move. + +1. Add `antigravity` to `FLAT_TARGETS`, update the cell-count title, run with `UPDATE_FRAMEWORK_GOLDEN=1`. +2. `git diff` the golden file: every changed key is `antigravity:flat`. +3. `ci.yml` matrix row, `MAINTAINERS.md` archive count, root parity test list, `smoke-tools.sh`, mutation scope and script. + +### `4)` Ownership under a shared `.agents/` + +> The Codex-shared case is a known bug outside #511; prove only that AIDD never touches a foreign file. + +1. Integration test: setup antigravity, add a user file under `.agents/skills/`, clean antigravity, user file intact. + +### `5)` Full suite and size + +1. `cd cli && pnpm test`, `pnpm exec lefthook run pre-commit`, bundle size check; raise the budget only with a registry line. +2. Diff size: if over 600 lines, move task 4 or the test-enumeration edits that are pure lists into a follow-up commit, never the golden cell. + +## Test acceptance criteria + +| Task | Acceptance criteria | +| ---- | ------------------- | +| 1 | `translate --to antigravity --as flat` writes `.agents/skills/-/SKILL.md`, one level deep, and no other artifact; `aidd setup --ai antigravity` installs the same skills; no other tool's setup output changes | +| 2 | `aidd setup --ai antigravity` succeeds, `aidd --help` and the menu list it, the arch tests pass | +| 3 | `golden.json` gains exactly one key, `antigravity:flat`; no existing cell changes; `ci.yml` builds the new archive | +| 4 | Cleaning Antigravity leaves a user file under `.agents/` in place | +| 5 | The full CLI suite and pre-commit pass on the branch | diff --git a/aidd_docs/tasks/2026_10/2026_10_02_antigravity-flat-host/phase-3.md b/aidd_docs/tasks/2026_10/2026_10_02_antigravity-flat-host/phase-3.md new file mode 100644 index 000000000..9ecbafac5 --- /dev/null +++ b/aidd_docs/tasks/2026_10/2026_10_02_antigravity-flat-host/phase-3.md @@ -0,0 +1,107 @@ +--- +status: done +--- + + + +# Instruction: Memory hook in `.agents/hooks.json` + +## Architecture projection + +> Tree of the final files. ✅ create · ✏️ modify · ❌ delete + +```txt +cli/ +├── src/contexts/tools/domain/ +│ ├── formats/ +│ │ ├── project-hooks-format.ts ✅ per-tool project hooks file strategy: merge, unmerge, contributed entries, empty check, script path and dir +│ │ └── cursor-hooks-project-merge.ts ✏️ Cursor's functions exposed as one `ProjectHooksFormat`, behaviour unchanged +│ ├── capabilities/plugins-capability.ts ✏️ `hooksDestination: "project"` + `projectHooksRelativePath` + `projectHooksFormat` allowed on flat params too +│ ├── build-contract.ts ✏️ `hooksMerge` receives the plugin name +│ └── profiles/ +│ ├── cursor/profile.ts ✏️ declares Cursor's `ProjectHooksFormat` +│ └── antigravity/ +│ ├── antigravity-hooks.ts ✅ named-hook shape: one `` key, handlers under `SessionStart`, `cd .. && ` prefix, other events skipped with a warning +│ ├── profile.ts ✏️ flat `acceptsHooks: true`, `hooksDestination: "project"` on `.agents/hooks.json` +│ └── build.ts ✏️ hooks artifact: scripts under `.agents/hooks//`, hooksMerge into `.agents/hooks.json` +├── src/contexts/framework/application/ +│ ├── framework/translator/project-hooks-materializer.ts ✏️ reads the tool's `ProjectHooksFormat`; invalid JSON names the file; messages name the tool +│ └── shared/remove-project-hooks.ts ✏️ same, no Cursor import left +├── src/contexts/translate/application/strategies/flat-build-strategy.ts ✏️ passes the plugin name to `hooksMerge` +├── tests/contexts/tools/domain/profiles/antigravity/ +│ └── antigravity-hooks.unit.test.ts ✅ merge, idempotence, foreign keys kept, invalid JSON, unmerge, empty check, unmapped event warning +├── tests/ (Cursor project-hooks suites) ✏️ only messages that named Cursor generically, if any; behaviour assertions untouched +├── tests/ (antigravity profile, build, build-hooks-support-declaration, registry-conformance) ✏️ antigravity now delivers hooks to `.agents/hooks.json` +└── tests/golden/snapshots/framework-build/golden.json ✏️ `antigravity:flat` cell only +``` + +## User Journey + +```mermaid +flowchart TD + A[aidd setup --ai antigravity] --> B[.agents/hooks.json gains key aidd-context with SessionStart command, script under .agents/hooks/aidd-context/] + B --> C[agy new session in trusted folder] + C --> D[log: loaded N named hooks; memory refresh runs at repo root] + E[aidd clean antigravity] --> F[aidd-context key and its scripts removed, other named hooks kept, file deleted only if empty] +``` + +## Test Scope + +```mermaid +--- +title: Test scope +--- +journey + section Setup + agy 1.2.17 logged in, interactive session under a pty, probe hook printing cwd and workspacePaths => measured cwd recorded: 5: system + section Happy path + aidd setup --ai antigravity on empty project => .agents/hooks.json has aidd-context SessionStart entry: 5: cli + second setup => file byte-identical: 5: cli + translate --to antigravity --as flat => same hooks.json shape and scripts under .agents/hooks/: 5: cli + section Edge case - user hooks present + .agents/hooks.json with user key lint => setup then clean => lint key unchanged: 5: cli + section Edge case - invalid JSON + unparsable .agents/hooks.json => setup => error names the file, file untouched: 1: cli + section Teardown + remove temp project => baseline restored: 5: system +``` + +## Tasks to do + +### `1)` Measure the hook `cwd` on 1.2.17 + +> #890 measured `cwd = /.agents` on 1.2.5; `update_memory.js` silently no-ops when `aidd_docs/` is not in `cwd`. + +1. Local probe: a `SessionStart` hook writing `pwd` and its stdin payload to a marker; read the marker, not the turn. On 1.2.17 a print-mode turn never reaches the model and fires no hook at all, so the probe runs interactive under a pty: `script -q /dev/null agy -i "reply OK" --add-dir `, killed after 60s. Without `--add-dir` it loads 0 hooks. +2. Measured on 2026-10-05: `cwd` is `/.agents`, as on 1.2.5; stdin carries `workspacePaths[0]` = ``. A root-relative command needs a `cd .. && ` prefix, and `agy` runs it through a shell: a real session running `cd .. && node ` wrote `AIDD-MEMORY-MARKER cwd= docs=true`. Record the evidence in the PR. + +### `2)` Named-hook format, test first + +> Shape `{ "": { "SessionStart": [ { "type": "command", "command": "…", "timeout": 30 } ] } }`: no top-level `hooks` wrapper, and handlers sit directly under the event. 1.2.17 rejects the Claude-style nested `[ { "hooks": [ … ] } ]` with `command hook must specify 'command'`; only `PreToolUse` and `PostToolUse` take a `matcher` entry. + +1. Tests: empty file, existing foreign keys, re-run idempotent, invalid JSON fails loud (Codex's silent `catch { parsed = {} }` is not copied), unmerge leaves foreign keys, empty check, an event other than `SessionStart` skipped with a warning (Claude and `agy` tool names differ; the telemetry host is out of scope). +2. Implement in `antigravity-hooks.ts` as a `ProjectHooksFormat`: the key is the plugin name, each command gets `cd .. && ` and runs `./.agents/hooks//