Skip to content

fix(templates): v0.8.5 default-manifest audit — ship starter-trio slash commands + audit pins (trinity-enterprise#239) - #1767

Merged
AndriiPasternak31 merged 2 commits into
devfrom
feature/ent239-manifest-audit
Jul 26, 2026
Merged

AndriiPasternak31 merged 2 commits into
devfrom
feature/ent239-manifest-audit

Conversation

@vybe

@vybe vybe commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Pre-release audit of the bundled default-system manifest for v0.8.5 (Abilityai/trinity-enterprise#239). Verdict: manifest passes — nothing trimmed or replaced. The audit surfaced one real first-run defect in the starter templates (fixed here) plus one test hardening.

Audit evidence (per AC)

  • Public / anonymously clonable: satisfied by construction — the manifest is local:-only (scout/sage/scribe), zero network and zero PAT at seed time. test_bundled_manifest_local_templates_exist_in_tree pins the local:-only invariant and tree existence.
  • Agents create and start (live): bundled manifest deployed verbatim through the executor's own path (POST /api/systems/deploy, strict=false — the exact seed semantics): status=deployed, 3/3 agents created and healthy (clone_status: ok), full-mesh = 6 permission edges, shared-folder mounts exactly as the templates document (sage sees shared-in/acme-scout, scribe sees both), agent MCP keys + .mcp.json present zero-cred. Torn down after verification.
  • Zero-cred useful (live first chat): scout/sage answered a cold "what can you do?" with useful, accurate onboarding; scribe/scout /status produced an honest zero-state report after the fix below. No credentials demanded, no crash, no dead agent.
  • Manifest hygiene (refactor: Split agent_server/services/claude_code.py (1003 lines) #122 caution): clean system name acme; no schedules:; no prompt: override; full-mesh + shared folders are deliberate and documented in-manifest (the trio's CLAUDE.md assumes the team shape). Pinned by test_bundled_manifest_parses_and_validates.
  • refactor: Split frontend large components (ProcessEditor, ReplayTimeline, TasksPanel) #125 interaction: resilient deploy IS in the cut. Partial-failure behavior covered by the ent#125 suite + ent#124 seed tests (partial → flag latches + one operator alert; failed → retry next boot).
  • Repo-side findings for bug: Cleanup service misses no-session running executions and doesn't terminal-state skipped executions #137: no external repos referenced. Cornelius defects (trinity#1646/bug: Cornelius seed vault's MOCs link to notes that don't ship — 22 of 23 wikilinks are dead #1656) are adjacent but out of manifest scope (separate seeder; declares no commands, so it does not share the defect below). A catalog-wide scan confirmed scout/sage/scribe were the only templates declaring commands without shipping them.

Finding + fix: documented slash commands failed as typed

Live first-chat exercise caught what the static pass could not: every documented command in all three templates was broken as typed. Claude Code intercepts any leading-/ message before the model sees it — /research returned Unknown command: /research, /status hit the disabled built-in — while the agents' own onboarding replies teach exactly that syntax (first-run paper cut, same class as trinity#1646).

Fix: ship real .claude/commands/<name>.md files for all 15 declared commands (the pattern trinity-system/demo-* templates already follow). Verified live on a fresh agent created from the updated template: /research engages per its command file, and a shipped status.md shadows the built-in /status. The startup template copy (find /template -mindepth 1) carries dot-dirs, so the files land on first boot.

Changes

  • config/agent-templates/{scout,sage,scribe}/.claude/commands/*.md — 15 command files, bodies faithful to each template's CLAUDE.md process docs, graceful no-argument handling
  • tests/unit/test_ent124_default_system_seed.py — test_bundled_manifest_templates_ship_declared_commands (declared↔shipped parity for every manifest-referenced template) + the earlier CLAUDE.md-existence pin

Verification

tests/unit $ python3 -m pytest test_ent124_default_system_seed.py -q
31 passed

Live (dev instance, current dev code): manifest dry-run valid → deploy deployed 3/3 → containers healthy → zero-cred chats useful → command files verified end-to-end (template → create → start → /research, /status) → all test agents deleted.

🤖 Generated with Claude Code

Eugene Vyborov and others added 2 commits July 25, 2026 13:03
…rinity-enterprise#239)

v0.8.5 pre-release audit of config/manifests/default-system.yaml: the
tree-existence guard only pinned template.yaml, so a template shipping
without CLAUDE.md would deploy 'successfully' but seed an agent with no
instructions — failing the zero-cred useful bar the audit enforces.

Audit outcome: manifest passes all checks (local:-only, no schedules,
no prompt override, deliberate full-mesh + shared folders, all three
templates present and zero-cred clean) — nothing trimmed or replaced.

Co-Authored-By: Claude Fable 5 <[email protected]>
…trio (trinity-enterprise#239)

Live first-chat exercise of the deployed acme fleet surfaced that every
documented command in scout/sage/scribe fails as typed: Claude Code
intercepts any leading-/ message before the model sees it, so /research
returns "Unknown command: /research" and /status hits the disabled
built-in — while the agents' own onboarding replies teach exactly that
syntax. Ship .claude/commands/<name>.md for all 15 declared commands
(the pattern trinity-system/demo-* templates already follow; a shipped
status.md shadows the built-in, verified live), and pin declared↔shipped
command parity for every manifest-referenced template in the ent#124
seed suite.

Co-Authored-By: Claude Fable 5 <[email protected]>
@vybe vybe changed the title test(seed): audit bundled default-system manifest for v0.8.5 + pin CLAUDE.md existence (trinity-enterprise#239) fix(templates): v0.8.5 default-manifest audit — ship starter-trio slash commands + audit pins (trinity-enterprise#239) Jul 25, 2026
@vybe
vybe marked this pull request as ready for review July 26, 2026 07:48
@github-actions

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

@AndriiPasternak31

Copy link
Copy Markdown
Contributor

PR Validation Report — /validate-pr

PR: #1767 — fix(templates): v0.8.5 default-manifest audit — ship starter-trio slash commands + audit pins
Author: @vybe · Branch: feature/ent239-manifest-audit → dev · Files: 16 (+195/−0) — 15 new, 1 modified (tests, additive only)
Linked issue: Abilityai/trinity-enterprise#239 — OPEN, priority-p1, type-feature, theme-devex, complexity-low
CI: ✅ green — 16 checks pass (gitleaks, CodeQL ×2, pytest head+base × 3 seeds, regression diff, schema-parity, verify-non-root, docker-gid, no-enterprise-submodule boot, lint); 3 skipped are ui-gated e2e + dependabot. BLOCKED was REVIEW_REQUIRED only, never a check failure.

Summary

Category Status Notes
Commit Messages ✅ 2 commits, conventional + descriptive
Base Branch ✅ Targets dev
PR Size ✅ 16 files, verified purely additive — git diff --stat origin/dev...head = 195 insertions, zero deletions, no modification outside the one additive test file
Status Auto-Promotion ⚠️ No closing keyword; cross-tracker anyway → manual status-in-dev bump required (see below)
Roadmap ✅ trinity-enterprise#239 resolves and is correctly labeled. Cross-tracker ref is the expected shape → not a failure
Requirements ➖ Agent-template content fix, no new platform capability
Architecture ➖ No endpoints, schema, components or integrations touched
Feature Flows ➖ No platform behavior change; template payload only
Security Check ✅ All 7 checks clean + public-repo content review passed (detail below)
Infrastructure ➖ No compose / Dockerfile / nginx in diff
Build Packaging (4.8) ➖ No new src/backend/*.py. Delivery path verified instead (below)
Config Packaging (4.9) ➖ No new os.getenv()
Test Adequacy ✅ Named regression test present — test_bundled_manifest_templates_ship_declared_commands, docstring names ent#239 and the exact failure mode
Code Quality ✅ Minimal, additive, faithful to each template's own CLAUDE.md; declared↔shipped parity 15/15
Requirements Trace ✅ Body maps evidence AC-by-AC

File classification (all 16)

15 new config/agent-templates/<t>/.claude/commands/<name>.md — YAML frontmatter (description, argument-hint) + $ARGUMENTS body with graceful no-argument handling:

Template New command files
scout (5) research, competitors, trends, opportunities, status
sage (5) analyze, recommend, framework, briefing, request-research
scribe (5) report, proposal, summary, deliverable, status

1 modified: tests/unit/test_ent124_default_system_seed.py (+32/−0) — a CLAUDE.md-existence assertion appended to the existing test, plus the new parity test. No existing assertion altered or removed.

Independent verification (run locally, read-only — not taken from the PR body)

  • Declared↔shipped parity on the branch: scout 5/5, sage 5/5, scribe 5/5 — 0 missing, 0 undeclared. The 15 files map exactly onto the 15 commands: entries in the three template.yamls.
  • Catalog-wide scan on dev confirms the scope claim: of 25 template dirs, only 5 declare commands:. demo-analyst (4/4) and demo-researcher (2/2) already shipped theirs; scout/sage/scribe were the only non-compliant templates. cornelius and the dd-* suite declare none.
  • Root cause confirmed: commands: in template.yaml is display metadata only — consumed by agent_server/routers/info.py:213 → /api/template/info → InfoPanel.vue:161 ("Slash Commands (N)"). Nothing generates a command file, so a declared-but-unshipped command could never work as typed. Genuine bug, not cosmetic.
  • Delivery mechanism confirmed: docker/base-image/startup.sh:304 uses find /template -mindepth 1 -maxdepth 1 -print0 | … cp -r — includes dot-dirs, and cp -r /template/.claude /home/developer/ merges into an existing .claude/ rather than nesting. ./config/agent-templates:/agent-configs/templates:ro is bind-mounted in both docker-compose.yml:251 and docker-compose.prod.yml:249, so the files reach containers on git pull + restart with no image rebuild.
  • Content fidelity spot-check: every command's save path matches its template's own CLAUDE.md convention (scout → shared-out/research/{competitors,trends,opportunities}/ + the {date}-{topic}-{type}.md rule; sage → strategy/{analyses,recommendations,briefings}/ + the SWOT/Porter/BCG/Ansoff list; scribe → deliverables/{reports,proposals,summaries}/).

Security

All seven Step-4 checks clean — 0 hits for keys/tokens, real emails, public IPs, .env, hardcoded secrets, credential files. In fact zero URLs of any kind in the entire diff. gitleaks CI pass.

Public-repo content review (extra scrutiny — this is shipped content): the 15 files are generic consulting-workflow prose. No internal/production URLs, no customer names ("Acme" is the repo's pre-existing fictional demo fleet, already in config/manifests/default-system.yaml and config/agent-templates/README.md), no real emails, no internal tooling references. No enterprise/paid-feature disclosure — no paid-feature names, no enterprise_* identifiers, no monetization/gating rationale, so the CLAUDE.md standing rule is satisfied. Note enterprise-docs-guard.yml is path-filtered to docs/**/CLAUDE.md/main.py/entitlement_service.py and legitimately did not trigger here — manual review found nothing it would have caught.

Issues found

Critical — none.

Warnings (non-blocking, all metadata/process hygiene)

  1. No closing keyword → no auto-promotion. The reference appears only as a parenthetical (Abilityai/trinity-enterprise#239). Two consequences: issue-status-on-merge.yml won't fire, and even with the keyword it couldn't, since GitHub's automation is same-repo only. Handled at merge — I set status-in-dev on ent#239 manually. It still needs a manual close at the v0.8.5 release cut.

  2. Three bare #N refs in the body mis-resolve to unrelated CLOSED public issues. On a public-repo PR these render against abilityai/trinity, not the enterprise tracker:

    Ref in body Resolves to (public, wrong) Intended (enterprise, right)
    (#122 caution) CLOSED — refactor: Split agent_server/services/claude_code.py OPEN — Epic: Fresh-install fleet provisioning…
    #125 interaction CLOSED — refactor: Split frontend large components OPEN — feat: Resilient system-manifest deploy…
    findings for #137 CLOSED — bug: Cleanup service misses no-session running executions OPEN — feat: Prepare the public agent fleet for the default installation

    Body text only, zero code impact — but it makes the audit record misleading to a future reader. Worth qualifying as Abilityai/trinity-enterprise#N next time. (trinity#1646 and the bare #1656 are correctly public.)

  3. Fix reaches new agents only — flag in the v0.8.5 release notes. startup.sh gates the template copy on the /home/developer/.trinity-initialized marker, so any agent already created from scout/sage/scribe keeps the broken commands until recreated. Correct and intentional for the fresh-install target this issue scopes, but operators running the trio today won't see the fix from a plain upgrade.

Suggestions (optional)

  1. Broaden the parity test catalog-wide. test_bundled_manifest_templates_ship_declared_commands iterates only manifest-referenced templates. demo-analyst/demo-researcher comply today (verified), but a future template — or a new command on an existing one — can regress silently. A loop over config/agent-templates/*/template.yaml makes the invariant catalog-wide for the same ~5 lines.
  2. Document the trap for external template authors. docs/TRINITY_COMPATIBLE_AGENT_GUIDE.md:356 presents commands: under "Slash commands with descriptions" with no hint that it's Info-tab metadata only and a real .claude/commands/<name>.md must ship alongside. That line is exactly what led three first-party templates here; one sentence prevents the class for the public template ecosystem.
  3. Test nits (test_ent124_default_system_seed.py): (template_dir / "template.yaml").read_text() omits encoding="utf-8" while the sibling assertion two lines up includes it; .get("commands", []) raises TypeError if the key is present but null (.get("commands") or [] is safer); import yaml could sit at module scope.
  4. /status shadowing is verified live but not pinned — it depends on Claude Code's project-over-built-in precedence, upstream behavior a unit test can't cover.
  5. request-research.md hardcodes a deployed-name hint ("named acme-scout when deployed as the acme system"). Degrades gracefully (the command instructs list_agents() first) but goes stale under a different TRINITY_DEFAULT_SYSTEM_MANIFEST system name.

Recommendation

✅ APPROVE

Purely additive (+195/−0), no existing file modified or deleted, no platform code touched — the entire risk surface is agent-template payload plus one additive test. The fix is complete and independently verified: 15/15 declared commands now ship, the catalog-wide scan confirms scout/sage/scribe were the only offenders, the root cause is real (commands: is display-only metadata), and the delivery path is confirmed through the ro bind mount present in both compose files. Security clean on all seven checks with zero URLs and no enterprise disclosure. CI green including gitleaks and pytest on head + base across three seeds. The cross-tracker reference resolves and is correctly labeled — per the skill, the expected shape, not a failure.

All three warnings are metadata/process hygiene, not code defects; none justifies holding a P1 fix for the v0.8.5 fresh-install path.

🤖 Validated with Claude Code via /validate-pr

@AndriiPasternak31 AndriiPasternak31 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via /validate-pr — see report above. Purely additive (+195/−0, zero deletions); declared↔shipped command parity independently verified 15/15, catalog-wide scan confirms scout/sage/scribe were the only non-compliant templates, root cause (commands: is Info-tab display metadata only) and delivery path (startup.sh:304 dot-dir copy over the ro bind mount in both compose files) both confirmed. Named regression test present. Security clean, zero URLs, no enterprise disclosure. Three warnings are metadata hygiene only — none blocking.

@AndriiPasternak31
AndriiPasternak31 merged commit f7aff46 into dev Jul 26, 2026
20 checks passed
@AndriiPasternak31
AndriiPasternak31 deleted the feature/ent239-manifest-audit branch July 26, 2026 09:35
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.

2 participants