diff --git a/agent-pack/CAPABILITY_MATRIX.md b/agent-pack/CAPABILITY_MATRIX.md index 5a901f2..125c4c5 100644 --- a/agent-pack/CAPABILITY_MATRIX.md +++ b/agent-pack/CAPABILITY_MATRIX.md @@ -12,21 +12,21 @@ ## Matrix -| Capability | OpenCode | Codex CLI | -|---|---|---| -| **Agents / roles** | SUPPORTED — `builder` (generic implementation), `arch-data-engineer` (specialist, scoped permissions), `reviewer` (read-only, restricted permissions), `planner` (read-only planning and routing), `mechanical` (deterministic low-judgment operations) | NOT YET ASSESSED — outside this NeuralEngine-only slice | -| **Skills / contracts** | SUPPORTED — 5 skills: neuralengine, repository-review, python-project-validation, arch-linux-diagnostics, verification | SUPPORTED WITH LIMITATIONS — NeuralEngine contract projection only; other contracts remain unmapped | -| **Global instructions** | SUPPORTED — `neuralengine-usage.md` loaded via `opencode.json` instructions array | SUPPORTED WITH LIMITATIONS — short `AGENTS.md` pointer; Codex CLI runtime discovery not exercised here | -| **Permissions** | SUPPORTED — Agent-level permission blocks with allow/deny/ask for edit, bash, task, tools. Reviewer enforces read-only. | SUPPORTED WITH LIMITATIONS — Codex host sandbox/approval controls remain authoritative; no adapter write authority | -| **Shell execution** | SUPPORTED — Scoped bash allowlist for `arch-data-engineer` (read-only diagnostics and validation; commit, push, destructive Git/filesystem/partitioning commands, and Ruff auto-fix denied). Restricted allowlist for `reviewer`. | SUPPORTED WITH LIMITATIONS — `neural` commands are ordinary host shell commands; executable/PATH/runtime behavior not verified | -| **Repository instructions** | SUPPORTED — `AGENTS.md`, `CODEX.md`, `VISION.md`, `CONTEXT.md`, `pyproject.toml` awareness built into agent rules | SUPPORTED WITH LIMITATIONS — Codex CLI native `AGENTS.md` pointer for substantive/consequential work | -| **NeuralEngine CLI** | SUPPORTED — `neural status` and `neural search` available and used in all reviews | SUPPORTED WITH LIMITATIONS — projection preserves `neural status`, targeted retrieval, and read-only boundaries; target installation not verified | -| **Review** | SUPPORTED — `repository-review` skill, reviewer agent with read-only permissions, formal review format with verdict/checkpoint/validation/scope/findings | NOT YET ASSESSED | -| **Verification** | SUPPORTED — reviewer agent with `verification` skill and enforced read-only command permissions (8 additional allow patterns: find, test, wc, sha256sum, diff, cmp, grep, sed). Quick Verification runs without permission prompts. | NOT YET ASSESSED | -| **Certification** | SUPPORTED — Certification Report template, 3 verdicts (CERTIFIED/CERTIFIED WITH NOTES/NOT CERTIFIED), collision-safe naming, `.agent-work/certifications/` convention | NOT YET ASSESSED | -| **Model selection** | SUPPORTED — Model configured in OpenCode runtime. Agent Pack is model-agnostic (DeepSeek V4 Pro Max, GPT-5.6 Sol Medium, others) | NOT YET ASSESSED | -| **Non-interactive execution** | SUPPORTED WITH LIMITATIONS — Bash commands execute non-interactively. Human confirmation required only for restricted operations per permission model. | NOT YET ASSESSED | -| **Artifact generation** | SUPPORTED — Review artifacts, certification reports, documentation files generated as markdown. No code generation or template engines. | NOT YET ASSESSED | +| Capability | OpenCode | Codex CLI | Goose CLI/Desktop | +|---|---|---|---| +| **Agents / roles** | SUPPORTED — `builder` (generic implementation), `arch-data-engineer` (specialist, scoped permissions), `reviewer` (read-only, restricted permissions), `planner` (read-only planning and routing), `mechanical` (deterministic low-judgment operations) | NOT YET ASSESSED — outside this NeuralEngine-only slice | NOT YET ASSESSED — custom agents are outside this bounded slice | +| **Skills / contracts** | SUPPORTED — 5 skills: neuralengine, repository-review, python-project-validation, arch-linux-diagnostics, verification | SUPPORTED WITH LIMITATIONS — NeuralEngine contract projection only; other contracts remain unmapped | SUPPORTED WITH LIMITATIONS — NeuralEngine contract projection only; other contracts remain unmapped | +| **Global instructions** | SUPPORTED — `neuralengine-usage.md` loaded via `opencode.json` instructions array | SUPPORTED WITH LIMITATIONS — short `AGENTS.md` pointer; Codex CLI runtime discovery not exercised here | SUPPORTED WITH LIMITATIONS — short `AGENTS.md` pointer; Desktop launcher discovery remains environment-dependent | +| **Permissions** | SUPPORTED — Agent-level permission blocks with allow/deny/ask for edit, bash, task, tools. Reviewer enforces read-only. | SUPPORTED WITH LIMITATIONS — Codex host sandbox/approval controls remain authoritative; no adapter write authority | SUPPORTED WITH LIMITATIONS — Goose host permission/approval controls remain authoritative; no adapter write authority | +| **Shell execution** | SUPPORTED — Scoped bash allowlist for `arch-data-engineer` (read-only diagnostics and validation; commit, push, destructive Git/filesystem/partitioning commands, and Ruff auto-fix denied). Restricted allowlist for `reviewer`. | SUPPORTED WITH LIMITATIONS — `neural` commands are ordinary host shell commands; executable/PATH/runtime behavior not verified | SUPPORTED WITH LIMITATIONS — Developer shell tools are documented; executable/PATH/runtime behavior is target-environment dependent | +| **Repository instructions** | SUPPORTED — `AGENTS.md`, `CODEX.md`, `VISION.md`, `CONTEXT.md`, `pyproject.toml` awareness built into agent rules | SUPPORTED WITH LIMITATIONS — Codex CLI native `AGENTS.md` pointer for substantive/consequential work | SUPPORTED WITH LIMITATIONS — Goose project context files are documented; exact Desktop conflict precedence remains unverified | +| **NeuralEngine CLI** | SUPPORTED — `neural status` and `neural search` available and used in all reviews | SUPPORTED WITH LIMITATIONS — projection preserves `neural status`, targeted retrieval, and read-only boundaries; target installation not verified | SUPPORTED WITH LIMITATIONS — projection preserves `neural status`, targeted retrieval, and read-only boundaries; target installation and Desktop command availability not verified | +| **Review** | SUPPORTED — `repository-review` skill, reviewer agent with read-only permissions, formal review format with verdict/checkpoint/validation/scope/findings | NOT YET ASSESSED | NOT YET ASSESSED — outside this bounded slice | +| **Verification** | SUPPORTED — reviewer agent with `verification` skill and enforced read-only command permissions (8 additional allow patterns: find, test, wc, sha256sum, diff, cmp, grep, sed). Quick Verification runs without permission prompts. | NOT YET ASSESSED | NOT YET ASSESSED — outside this bounded slice | +| **Certification** | SUPPORTED — Certification Report template, 3 verdicts (CERTIFIED/CERTIFIED WITH NOTES/NOT CERTIFIED), collision-safe naming, `.agent-work/certifications/` convention | NOT YET ASSESSED | NOT YET ASSESSED — outside this bounded slice | +| **Model selection** | SUPPORTED — Model configured in OpenCode runtime. Agent Pack is model-agnostic (DeepSeek V4 Pro Max, GPT-5.6 Sol Medium, others) | NOT YET ASSESSED | NOT YET ASSESSED — outside this bounded slice | +| **Non-interactive execution** | SUPPORTED WITH LIMITATIONS — Bash commands execute non-interactively. Human confirmation required only for restricted operations per permission model. | NOT YET ASSESSED | NOT YET ASSESSED — outside this bounded slice | +| **Artifact generation** | SUPPORTED — Review artifacts, certification reports, documentation files generated as markdown. No code generation or template engines. | NOT YET ASSESSED | NOT YET ASSESSED — outside this bounded slice | ## Codex CLI assessment notes diff --git a/agent-pack/MANIFEST.md b/agent-pack/MANIFEST.md index 39ff518..051ee39 100644 --- a/agent-pack/MANIFEST.md +++ b/agent-pack/MANIFEST.md @@ -2,14 +2,14 @@ ## Shared-to-platform mapping -| Authoritative source | OpenCode target | Codex CLI target | -|---|---|---| -| `shared/neuralengine.md` | global instruction (`neuralengine-usage.md`) and NeuralEngine skill | `platforms/codex/skills/neuralengine/SKILL.md` (controlled copy; install target is `.agents/skills/neuralengine/SKILL.md`) | -| `shared/repository-review.md` | repository-review skill | not mapped in this slice | -| `shared/python-validation.md` | python-project-validation skill | not mapped in this slice | -| `shared/arch-linux.md` | arch-linux-diagnostics skill | not mapped in this slice | -| `shared/verification.md` | verification skill (Quick, Standard, and Certification implemented) | not mapped in this slice | -| `shared/task-execution-policy.md` | no platform copy (vocabulary contract, deferred consumption) | no platform copy (vocabulary contract, deferred consumption) | +| Authoritative source | OpenCode target | Codex CLI target | Goose CLI/Desktop target | +|---|---|---|---| +| `shared/neuralengine.md` | global instruction (`neuralengine-usage.md`) and NeuralEngine skill | `platforms/codex/skills/neuralengine/SKILL.md` (controlled copy; install target is `.agents/skills/neuralengine/SKILL.md`) | `platforms/goose/skills/neuralengine/SKILL.md` (controlled copy; install target is `.agents/skills/neuralengine/SKILL.md`) | +| `shared/repository-review.md` | repository-review skill | not mapped in this slice | not mapped in this slice | +| `shared/python-validation.md` | python-project-validation skill | not mapped in this slice | not mapped in this slice | +| `shared/arch-linux.md` | arch-linux-diagnostics skill | not mapped in this slice | not mapped in this slice | +| `shared/verification.md` | verification skill (Quick, Standard, and Certification implemented) | not mapped in this slice | not mapped in this slice | +| `shared/task-execution-policy.md` | no platform copy (vocabulary contract, deferred consumption) | no platform copy (vocabulary contract, deferred consumption) | no platform copy (vocabulary contract, deferred consumption) | ## Platform-specific files (no shared equivalent) @@ -20,6 +20,7 @@ - `agents/planner.md` - `agents/mechanical.md` - `codex/AGENTS.md` +- `goose/AGENTS.md` These files are platform-specific configuration artifacts. They have no corresponding shared source in this pack. diff --git a/agent-pack/README.md b/agent-pack/README.md index c1a2843..86580ef 100644 --- a/agent-pack/README.md +++ b/agent-pack/README.md @@ -13,6 +13,7 @@ repository—not a separate product. - One complete platform variant (OpenCode) derived from the user's current, working OpenCode configuration. - One bounded Codex CLI NeuralEngine skill projection. +- One bounded Goose CLI/Desktop NeuralEngine skill projection. - Placeholder directories for future Claude Code and Antigravity platform variants. @@ -49,6 +50,7 @@ contract and introduces the generic builder agent: | ACP independent review | PASS | | OpenCode | Supported | | Codex CLI NeuralEngine slice | Supported with limitations (CLI only) | +| Goose CLI/Desktop NeuralEngine slice | Supported with limitations (bounded post-v1.0 extension) | | Claude Code | Placeholder (not implemented) | | Antigravity | Placeholder (not implemented) | @@ -213,6 +215,7 @@ OpenCode platform implementation: - [platforms/opencode/](platforms/opencode/) — OpenCode adapter and skills. - [platforms/codex/](platforms/codex/) — Codex CLI NeuralEngine adapter slice. +- [platforms/goose/](platforms/goose/) — Goose CLI/Desktop NeuralEngine adapter slice. - [platforms/opencode/agents/planner.md](platforms/opencode/agents/planner.md) — Read-only planning and routing agent. - [platforms/opencode/agents/builder.md](platforms/opencode/agents/builder.md) — Generic builder agent (new in v0.4.0). - [platforms/opencode/agents/arch-data-engineer.md](platforms/opencode/agents/arch-data-engineer.md) — Specialist implementation agent. diff --git a/agent-pack/platforms/goose/AGENTS.md b/agent-pack/platforms/goose/AGENTS.md new file mode 100644 index 0000000..59eea05 --- /dev/null +++ b/agent-pack/platforms/goose/AGENTS.md @@ -0,0 +1,7 @@ +# Goose CLI/Desktop NeuralEngine pointer + +For substantive or consequential work, consider the repository +neuralengine skill at .agents/skills/neuralengine/SKILL.md. + +The semantic authority is agent-pack/shared/neuralengine.md. This pointer +does not duplicate or redefine that contract. diff --git a/agent-pack/platforms/goose/README.md b/agent-pack/platforms/goose/README.md new file mode 100644 index 0000000..ea6b4a8 --- /dev/null +++ b/agent-pack/platforms/goose/README.md @@ -0,0 +1,51 @@ +# Goose CLI/Desktop Platform + +**Status:** NeuralEngine thin adapter implemented for Goose CLI/Desktop with +documented limitations. + +This is one bounded provider projection of +agent-pack/shared/neuralengine.md. It is a post-v1.0 extension of the Agent +Pack and does not change the v1.0 platform freeze. It does not modify +NeuralEngine runtime behavior, Brain persistence, schemas, APIs, or user-global +Goose configuration. + +## Adapter files + +- AGENTS.md — minimal project-instruction pointer; merge this pointer into a + target repository's project instructions without replacing unrelated rules. +- skills/neuralengine/SKILL.md — Goose-compatible project skill projection with + only the required name and description front matter. + +The skill body is a controlled copy of the shared contract. Drift validation +requires the body after front matter removal to remain byte-equal to +agent-pack/shared/neuralengine.md. + +## Manual installation mapping + +Installation is explicit and manual, consistent with the Agent Pack +architecture: + +skills/neuralengine/SKILL.md +→ /.agents/skills/neuralengine/SKILL.md + +The AGENTS.md content is a pointer to merge into the target repository's +project instructions. This package does not provide an installer, write to +user-global Goose configuration, or create a second semantic copy for Desktop. + +## Discovery and limitations + +- Goose documents AGENTS.md and .goosehints as project context files. +- Goose documents project Agent Skills under .agents/skills//SKILL.md; + the .agents/skills projection is therefore shared by the CLI and Desktop + slice. +- Goose CLI and Desktop expose host-controlled shell/tool permissions. The + adapter grants no additional read, write, Brain-write, staging, commit, push, + merge, tag, release, or publication authority. +- The neural executable, PATH, Brain access, and command behavior must be + verified in each target environment. Desktop launchers may use a different + environment from an interactive shell. +- Local verification found Goose CLI 1.45.0; Desktop version/help probing was + not independently available because the Electron launcher attempted read-only + host state and graphics/session initialization. + +No automatic installation or Brain write is performed. diff --git a/agent-pack/platforms/goose/skills/neuralengine/SKILL.md b/agent-pack/platforms/goose/skills/neuralengine/SKILL.md new file mode 100644 index 0000000..2d69e45 --- /dev/null +++ b/agent-pack/platforms/goose/skills/neuralengine/SKILL.md @@ -0,0 +1,341 @@ +--- +name: neuralengine +description: Use NeuralEngine as the durable project knowledge, decision, experience, and playbook layer for substantive repository, architecture, review, diagnostic, planning, and authorized Brain tasks. +--- +# Mandatory NeuralEngine Usage + +NeuralEngine is the default durable knowledge and decision layer for all agents and models. + +Repository sources describe the current implementation. NeuralEngine may contain prior decisions, experience, knowledge, playbooks, and provenance that are not recoverable from the current working tree alone. + +## Authority model + +Treat sources according to their role: + +1. repository source defines the current implementation; +2. repository instructions define local execution constraints; +3. NeuralEngine provides durable knowledge, decisions, experience, playbooks, and provenance; +4. current command output provides direct runtime evidence; +5. external documentation provides supporting context. + +Do not use NeuralEngine records to override current repository source without explaining the conflict. + +Do not assume a record is authoritative merely because it exists. + +Evaluate: + +* lifecycle state; +* provenance; +* project key; +* source record; +* timestamps; +* superseding records; +* activation or revision state; +* applicability to the current task. + +## Start of work + +At the start of every substantive task, run: + +`neural status` + +A substantive task includes repository work, review, diagnosis, assessment, planning, implementation, or architecture analysis. + +Simple requests that only summarize already loaded instructions or skill contents do not require a new `neural status` call. + +Record whether NeuralEngine is: + +* available; +* unavailable; +* degraded; +* misconfigured; +* connected to the expected Brain. + +If `neural status` fails: + +1. preserve the exact error; +2. determine whether repository-only work can continue safely; +3. do not claim NeuralEngine usage; +4. record the limitation in the task report. + +## Search decision + +Before substantive analysis, review, diagnosis, planning, or editing, decide whether prior project knowledge, decisions, experience, or playbooks are relevant. + +Use `neural search` when prior durable knowledge may materially affect: + +* architecture; +* domain boundaries; +* persistence; +* migrations; +* security; +* public behavior; +* release decisions; +* previous incidents; +* diagnostic playbooks; +* project-specific conventions; +* prior accepted or rejected approaches. + +Repository source may be sufficient for: + +* exact current implementation inspection; +* isolated mechanical changes; +* syntax or formatting corrections; +* direct validation of an already defined task; +* runtime diagnosis based entirely on current logs. + +The absence of a search result is evidence only that no matching record was returned. It does not prove that no relevant knowledge exists. + +If relevant: + +1. run `neural search`; +2. record the exact query; +3. record returned record IDs and provenance; +4. explain briefly how the retrieved result affected the work. + +If not relevant: + +1. state explicitly that no NeuralEngine search was required; +2. explain why repository sources or current system evidence were sufficient. + +Do not claim NeuralEngine knowledge use based only on running `neural status`. + +## Query construction + +Use narrow, explicit queries. + +Start with one best query. + +Run a second query only when: + +- the first query reveals a distinct authoritative term; +- separate lifecycle or provenance records are required; +- the task spans two materially different contracts; +- the first result is ambiguous but establishes a better exact query. + +Do not issue repeated speculative searches merely because earlier searches returned no results. + +For ordinary repository work, use no more than two queries unless the task is explicitly a Brain investigation, migration, architecture assessment, or historical audit. + +Prefer queries containing: + +* project name or project key; +* affected domain; +* exact contract; +* lifecycle stage; +* relevant component; +* issue or decision being investigated. + +Avoid vague queries such as `architecture`, `bugs`, or `project decisions`. + +Record every exact query used. + +Do not silently rewrite the query in the final report. + +## Search result handling + +For every relevant result, record: + +* record ID; +* record type; +* project key; +* lifecycle state; +* provenance; +* source or parent record when present; +* why it is relevant; +* how it affected the task. + +Distinguish record types: + +### Observation + +Raw or normalized evidence about something that occurred. + +Do not treat an Observation as a durable conclusion. + +### Experience + +Interpreted evidence from completed work or outcomes. + +Use it as operational learning, not as universal truth. + +### Knowledge + +Durable, reusable understanding promoted through the defined lifecycle. + +Check its provenance and integrity boundaries before relying on it. + +### Playbook + +Reusable operational procedure. + +Verify: + +* active revision; +* applicability; +* inputs; +* constraints; +* expected outcome; +* execution provenance requirements. + +### PlaybookRun + +Evidence that a specific playbook revision was executed. + +Do not infer execution from playbook existence alone. + +### Evaluation + +Assessment of a run or outcome. + +Check the evaluated target and evidence. + +### EvolutionProposal + +Proposal for improving a playbook or durable behavior. + +It is not automatically accepted or active. + +### DecisionReview + +Structured review of a decision and its outcome. + +Check status, outcome evidence, and promotion state. + +## Provenance + +Never report only a record ID when provenance is available. + +Provenance may include: + +* source repository; +* source checkpoint; +* source review; +* originating observation; +* originating experience; +* promotion path; +* playbook revision; +* activation; +* application; +* execution record; +* user authorization. + +When provenance is missing or incomplete: + +1. state the limitation; +2. reduce confidence; +3. do not silently infer the missing chain. + +## Conflicts + +When NeuralEngine and repository source appear to conflict: + +1. identify the exact conflicting statements; +2. determine whether the Brain record is stale, superseded, or scoped differently; +3. prefer current implementation for present behavior; +4. preserve durable decisions that still apply; +5. report the conflict explicitly. + +Do not automatically update Brain records. + +Do not automatically modify repository source to match an old record. + +## Read boundary + +Read-only NeuralEngine operations are allowed without additional approval. + +This includes: + +* `neural status`; +* `neural search`; +* reading returned records and provenance; +* reading record details; +* inspecting provenance; +* inspecting lifecycle state; +* inspecting playbook revisions and runs. + +Do not describe an operation as read-only unless it cannot persist or promote data. + +## Brain write boundary + +Any Brain write requires explicit user authorization. + +Before requesting authorization, provide a preview containing: + +* proposed record type; +* proposed project key; +* proposed title or identifier; +* proposed content summary; +* source evidence; +* provenance; +* intended lifecycle state; +* expected effect; +* whether the write creates, updates, promotes, activates, or evaluates anything. + +Do not perform any of the following without explicit authorization: + +* create a record; +* update a record; +* promote Experience to Knowledge; +* promote DecisionReview to Experience; +* create or revise a Playbook; +* activate a Playbook revision; +* record a PlaybookRun; +* create an Evaluation; +* create an EvolutionProposal; +* change lifecycle state; +* backfill provenance; +* repair Brain data. + +Authorization for one write does not authorize later writes. + +## Lifecycle boundaries + +Do not automatically promote records between lifecycle stages. + +Creation, review, acceptance, activation, application, evaluation, and evolution are separate actions. + +Do not collapse: + +* Observation into Experience; +* Experience into Knowledge; +* DecisionReview into Experience; +* PlaybookRevision into activation; +* activation into application; +* application into PlaybookRun; +* PlaybookRun into Evaluation; +* Evaluation into EvolutionProposal. + +Each transition requires its own contract and authorization where applicable. + +## Required evidence + +Every substantive task report must contain a `NeuralEngine usage` section containing: + +* the result of `neural status`; +* whether `neural search` was used; +* exact search queries and returned record IDs when used; +* provenance; +* a brief explanation of how retrieved knowledge affected the work; +* or an explicit explanation why repository sources or current system evidence were sufficient and no search was needed. + +When the task produces a review file, include this evidence in that file. + +Otherwise include it in the final task report. + +Do not claim NeuralEngine usage based only on running `neural status`. + +## Completion rules + +Before considering NeuralEngine-related work complete: + +* verify the exact repository checkpoint; +* verify the project key; +* verify record IDs; +* verify provenance; +* verify lifecycle state; +* verify whether any write occurred; +* verify that every write had explicit authorization; +* verify that no automatic promotion occurred. + +Do not commit or push repository changes without separate explicit authorization. diff --git a/tests/test_goose_adapter.py b/tests/test_goose_adapter.py new file mode 100644 index 0000000..f937e5a --- /dev/null +++ b/tests/test_goose_adapter.py @@ -0,0 +1,100 @@ +"""Drift and scope checks for the bounded Goose NeuralEngine adapter.""" + +from pathlib import Path + + +def _source_root() -> Path: + """Return the Handbook repository root.""" + return Path(__file__).resolve().parents[1] + + +def _goose_root() -> Path: + """Return the controlled Goose platform source directory.""" + return _source_root() / "agent-pack" / "platforms" / "goose" + + +def _skill() -> Path: + """Return the controlled Goose NeuralEngine skill projection.""" + return _goose_root() / "skills" / "neuralengine" / "SKILL.md" + + +def _shared() -> Path: + """Return the authoritative shared NeuralEngine contract.""" + return _source_root() / "agent-pack" / "shared" / "neuralengine.md" + + +def _body(content: str) -> str: + """Return a skill body after its front matter.""" + lines = content.splitlines(keepends=True) + assert lines and lines[0].strip() == "---" + closing = next( + (index for index, line in enumerate(lines[1:], start=1) if line.strip() == "---"), + None, + ) + assert closing is not None + return "".join(lines[closing + 1 :]) + + +class TestGooseNeuralEngineAdapter: + """Tests for the single Goose CLI/Desktop projection.""" + + def test_expected_platform_paths(self) -> None: + """The adapter contains only its pointer, README, and one skill.""" + paths = sorted( + path.relative_to(_goose_root()).as_posix() + for path in _goose_root().rglob("*") + if path.is_file() + ) + assert paths == [ + "AGENTS.md", + "README.md", + "skills/neuralengine/SKILL.md", + ] + + def test_skill_has_only_required_frontmatter(self) -> None: + """The provider adds only the required Agent Skills metadata.""" + lines = _skill().read_text(encoding="utf-8").splitlines() + assert lines[0] == "---" + closing = lines.index("---", 1) + assert lines[1:closing] == [ + "name: neuralengine", + "description: Use NeuralEngine as the durable project knowledge, decision, experience, and playbook layer for substantive repository, architecture, review, diagnostic, planning, and authorized Brain tasks.", + ] + + def test_skill_body_matches_shared_contract(self) -> None: + """Goose cannot silently diverge from the canonical semantic source.""" + assert _body(_skill().read_text(encoding="utf-8")) == _shared().read_text(encoding="utf-8") + + def test_pointer_is_minimal_and_canonical(self) -> None: + """The project pointer refers to the skill without duplicating policy.""" + content = (_goose_root() / "AGENTS.md").read_text(encoding="utf-8") + assert ".agents/skills/neuralengine/SKILL.md" in content + assert "agent-pack/shared/neuralengine.md" in content + assert "does not duplicate or redefine that contract" in content + assert "## Authority model" not in content + assert "neural knowledge search" not in content + assert "Brain-write" not in content + + def test_readme_describes_one_shared_cli_desktop_projection(self) -> None: + """Documentation states the bounded shared CLI/Desktop boundary.""" + content = (_goose_root() / "README.md").read_text(encoding="utf-8") + assert "Goose CLI/Desktop" in content + assert ".agents/skills//SKILL.md" in content + assert "shared by the CLI and Desktop" in content + assert "second semantic copy for Desktop" in content + assert "No automatic installation or Brain write is performed." in content + + def test_adapter_does_not_claim_provider_independent_authority(self) -> None: + """The Goose files preserve host permissions and publication boundaries.""" + content = "\n".join( + path.read_text(encoding="utf-8") for path in _goose_root().rglob("*") if path.is_file() + ) + for phrase in ( + "grants no additional", + "Brain-write", + "staging", + "commit", + "push", + "publication", + ): + assert phrase in content