Skip to content

feat(library): rename Templates page to Library — one surface for agent templates + skills (ent#263) - #1904

Merged
dolho merged 10 commits into
devfrom
feature/ent263-library-page
Jul 31, 2026
Merged

dolho merged 10 commits into
devfrom
feature/ent263-library-page

Conversation

@vybe

@vybe vybe commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Fixes abilityai/trinity-enterprise#263

Summary

Two-commit pure-git mv rename (Templates.vue → Library.vue, then content edits) + a /library route with a query+hash-preserving /templates redirect. Adds a fleet-level skills browse section over the existing /api/skills reads — isolated in stores/skillsLibrary.js, zero overlap with open PR #1901's files — plus dormant slots for #1901's source/shadowed fields. e2e anchors + docs updated; stale-doc cleanup (dead env-template/refresh endpoints, dead skills-management links).

Flags

  • AC#3 fleet-assignment counts deferred — fully specified follow-up (plan §6.2); both plan second-voices objected to bundling it here, so the operator owns the renegotiation. The ~40-line severable GET /api/skills/assignments endpoint is viable now.
  • AC#4 page-identity interpretation — rename covers page identity (nav label, route, page title, headings say Library); "template" survives as the asset noun for the agent-template kind. See the issue comment.
  • Filter pills dropped in favor of stacked sections (Agent Templates / Skills).
  • Security hardening in-branch: stripUserinfo rewritten after 5 proven credential-leak shapes (26-case adversarial suite); shared with SkillsPanel.

Test evidence

  • verify-local --skip-agent PASS
  • Bundle-level proof from the built prod image: library route present, redirect works with query+hash, NavBar clean, 5 asset-noun-only 'Templates' hits
  • Live tests/test_templates.py: 5 passed
  • Unit suite: 5726 greens (1 pre-existing env red, proven on base)

Merge-order notes

Follow-ups (listed, NOT filed)

🤖 Generated with Claude Code

@vybe vybe added the ui PR touches the frontend UI — triggers Playwright e2e tests label Jul 31, 2026
Eugene Vyborov and others added 8 commits July 31, 2026 10:09
…ent#263)

Byte-pure git mv with zero content edits so git rename detection holds
and a parallel edit to Templates.vue (ent#260) resolves as a content
merge inside Library.vue rather than a modify/delete conflict. All
content changes land in follow-up commits.

Co-Authored-By: Claude Fable 5 <[email protected]>
…ect (ent#263)

- Library.vue: h1 'Library', new subtitle, templates content wrapped in an
  'Agent Templates' section (own loading/error/empty states; inner headings
  demoted h2->h3); fetch migrated to the shared api client (Invariant #7)
- router: /library route (meta.title Library) + /templates function-form
  redirect carrying query AND hash; route name Templates->Library (no named
  pushes exist)
- NavBar: label Library, to=/library, active via startsWith('/library')
- CreateAgentModal: its single raw-axios /api/templates call migrated to the
  shared api client so no half-migrated consumer of the endpoint remains

Page-identity naming only (AC#4 reading): the asset-kind noun 'template'
survives inside the Library (Starter/GitHub Templates sections, Use Template).

Co-Authored-By: Claude Fable 5 <[email protected]>
… library (ent#263)

- stores/skillsLibrary.js (new): fleet-scoped store, deliberately separate
  from stores/skills.js (KeepAlive-cached AgentDetail means SkillsPanel's
  clear() never fires on nav-away — shared refs would poison the cached tab);
  imports nothing from stores/skills.js. 4-state emptyReason discriminator
  (unconfigured/not_cloned/empty + error carried separately); sync() with a
  180s timeout and ECONNABORTED -> status-refetch (a first clone can outlive
  the 30s api.js default; client timeout != server failure)
- components/LibrarySkillsSection.vue (new): sync-state header leads with
  commit_sha + skill_count (disk-derived; last_sync is per-worker in-memory
  and renders only when truthy); repo URL admin-only, userinfo-stripped,
  labeled 'Primary source', hidden when status.sources reports >1 (#1901
  forward-compat); admin Sync now; per-kind empty states teaching the next
  action; dormant source_name/shadowed_by slots; interpolation only
- components/skills/{SkillContractChips.vue,contract.js} (new): the #183
  contract-chips seam extracted from SkillsPanel so both the per-agent tab
  and the Library browse render package facts from one seam
- SkillsPanel.vue: consumes the shared seam (local SkillMeta/formatBytes/deps
  removed); stores/skills.js untouched
- Library.vue: skills section wired in + header jump anchors (no ?kind=)

Co-Authored-By: Claude Fable 5 <[email protected]>
…263)

- smoke.spec.js: '@smoke library page loads' asserts chrome-only getByRole
  headings (h1 Library + both section headings — the old getByText(/template/i)
  passed on the un-renamed page and proved nothing); new '@smoke templates path
  redirects to library'; stale nav comment fixed (Health/Ops merged in #1109)
- browser-tab-titles.spec.js: nav click asserts 'Trinity — Library'; redirect
  test also covers /templates -> /library title resolution
- tests/test_templates.py: remove TestEnvTemplate + TestTemplateRefresh —
  GET /api/templates/env-template and POST /api/templates/refresh no longer
  exist (router has exactly 2 GET routes; live-stack probe returns 404);
  test_get_template_by_id now exercises the REAL detail endpoint instead of
  the dead env-template detour that always skipped. 5 remaining tests pass
  against the live stack.

Co-Authored-By: Claude Fable 5 <[email protected]>
…endpoint rot sweep (ent#263)

- requirements/core-agent.md: new §4.5 Library Page — unified /library surface
  (agent templates + fleet skills browse), query+hash-preserving /templates
  redirect, stacked sections, per-kind empty states, the AC#4 page-identity
  naming rule; fleet assignment visibility named as Not Built
- requirements/skills.md (surgical — §21.3/§22.2/new §22.3 only, avoiding PR
  #1901's §21.1/§21.5 hunks): §21.3 stale 'Skills tab is hidden' note corrected
  (visible since ent#235/PR #1877); §22.2 rewritten as visible/rebuilt; new
  §22.3 Library Page fleet skills browse — browse-only over the existing
  /api/skills/library reads, own skillsLibrary store + the KeepAlive rationale,
  admin-only URL/Sync, #1901 forward-compat, assignment read = Not Built
- architecture.md: 'Top-nav IA — Library (ent#263)' paragraph beside the #1109
  Operations one; stale 'Templates (4 endpoints)' table corrected to the 2 real
  routes (POST /refresh AND GET /env-template both verified absent)
- feature-flows: templates-page.md git-mv'd to library-page.md + full rewrite
  (the old file was deeply stale — AgentSubNav, dead endpoints); index row +
  platform-settings.md Related-Flows link repointed
- template-processing.md + CREDENTIAL_MANAGEMENT.md: dead env-template
  endpoint references removed/replaced (same rot class as the architecture
  table); Templates.vue references repointed at Library.vue
- user docs (creating-agents.md, faq/agents.md): Templates page → Library
  (+ redirect note)

Co-Authored-By: Claude Fable 5 <[email protected]>
…s row, dead skills-management link purge (ent#263)

/sync-feature-flows verification pass over the branch diff:
- skill-assignment.md: note that SkillsPanel's package-fact chips now render
  via the shared components/skills/ contract seam (extracted in ent#263)
- feature-flows.md: Recent Updates row for ent#263; removed the stale 'Skills
  Management UI' index row — skills-management.md was split/archived long ago
  (the archive table records it) and the live row pointed at a missing file
- library-page.md: repointed its two skills-management.md links (propagated
  from the stale index row) at skill-assignment.md

Co-Authored-By: Claude Fable 5 <[email protected]>
…able URL shapes; share it with SkillsPanel (ent#263 review)

Adversarial testing of the display-layer credential scrubber proved five
leak shapes. Two families: the regex fallback under-matched what new URL()
rejects (git+ssh:// schemes, protocol-relative //user:token@host, leading
whitespace), and — worse — schemeless/scp user:token@host shapes PARSE as
a WHATWG URL with an opaque hostless path where .username/.password
assignment is a silent no-op, so the credential sailed through the success
lane untouched.

- move stripUserinfo to the shared components/skills/contract.js seam
- trust the parsed lane only when host is present AND the strip verifiably
  took (post-assignment username/password empty); otherwise fall through
  to a widened textual scrub (scheme charset [A-Za-z][\w+.-]*, protocol-
  relative, schemeless colon-user, trim)
- variant analysis: SkillsPanel's library_empty state rendered the RAW
  stored URL to any agent accessor — now scrubbed through the same helper
- verified by an executed 26-case suite (23 adversarial leak shapes ALL
  PASS + 3 must-survive-unmangled regressions: plain https, scp
  git@host:path, path-@ preserved)
- durable class captured in docs/memory/learnings.md

Co-Authored-By: Claude Fable 5 <[email protected]>
… (ent#263 review)

- feature-flows.md Archived Flows table pointed at
  archive/skills-management.md, which does not exist (the archive/ dir
  never received it) — same dead-link class d23005a purged from the
  skills index; row now says 'document not preserved' and names the
  dedicated flows it split into
- add the /cso --diff report for the ent#263 review: zero backend
  surface delta; one MEDIUM display-layer scrubber finding (proven,
  remediated in 820895b with variant coverage); secrets/enterprise-
  disclosure/XSS/supply-chain/CI categories clean

Co-Authored-By: Claude Fable 5 <[email protected]>
@vybe
vybe force-pushed the feature/ent263-library-page branch from b89ff6a to abef5f4 Compare July 31, 2026 09:10
@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.

@dolho

dolho commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

/review Report

Branch: feature/ent263-library-page → dev (merge-base 5b289996)
Files: 26 (+760/−652) — frontend + one test file
Scope: CLEAN — Templates page → Library (agent templates + skills library on one surface), per ent#263.
CI: green.

No critical findings. This one is careful about exactly the things a "render semi-trusted GitHub content" page should be.

Verified safe (with evidence)

  • The removed backend tests were dead-endpoint cleanup, not coverage loss. test_templates.py drops from 8 → 5 test functions, but the removed ones tested env-template / refresh endpoints — I confirmed those are absent on this branch and on dev, so the tests could only ever 404/skip. The surviving detail test was actually upgraded: it previously always skipped (detoured through the dead env-template route) and now hits the real /api/templates/{template_id:path} with a real assertion. Net coverage improves.
  • XSS discipline holds under inspection, not just in comments. LibrarySkillsSection.vue and SkillContractChips.vue carry "no v-html, no :href from library-derived strings" comments — and they're true: no v-html anywhere in the Library/skills components, and the only hrefs are static in-page anchors (#agent-templates, #skills), never a library-derived URL. contract.js even ships stripUserinfo() to keep user:pass@host out of any displayed repo URL.
  • Failed fetches surface as errors, not confident emptiness. stores/skillsLibrary.js keeps error as a first-class state separate from empty ("a load failure is an ERROR state, never 'empty'"), wraps the fetch in try/catch, and deliberately does not share refs with other pages so a failed load can't render inside a cached page.
  • Redirect + nav coherent. /templates → /library via the function-form redirect (query and hash preserved for the in-page section anchors); NavBar uses startsWith('/library') so future /library/... deep-links keep the tab lit.

Clean categories

SQL / auth / credentials — N/A (no backend logic changed; only a test file). Reactive state — the store's non-shared-refs rationale is sound and documented. Error handling — the store's error path is the model case. Docs — feature-flow + requirements updated in-diff.

Critical: 0 · Informational: 0 · Scope: clean. LGTM.

dolho added 2 commits July 31, 2026 14:29
…-page

# Conflicts:
#	docs/memory/feature-flows.md
#	docs/memory/learnings.md
…-page

# Conflicts:
#	docs/memory/feature-flows.md
#	src/frontend/e2e/browser-tab-titles.spec.js
#	src/frontend/e2e/smoke.spec.js
#	src/frontend/src/components/NavBar.vue
@dolho
dolho marked this pull request as ready for review July 31, 2026 11:50
@dolho
dolho merged commit dbbe2c7 into dev Jul 31, 2026
23 checks passed
AndriiPasternak31 added a commit that referenced this pull request Jul 31, 2026
ent#263 (PR #1904, merged today) renamed `Templates.vue` -> `Library.vue` and
restructured it into "installable assets for your fleet" — two stacked sections
with jump anchors — with a comment recording that tab/filter-pill navigation was
considered and deliberately rejected for this page.

ent#126 had built its install surface as an `?tab=agents|systems` strip on that
same page. Two independent designs for one page. This conforms to ent#263's
model rather than reintroducing a competing one: Systems becomes a third
`<section id="systems">` with its own jump anchor.

Placed BETWEEN Agent Templates and Skills, not appended: Systems and Agent
Templates both *install agents* (one template makes one agent, one manifest
makes a wired fleet), while Skills configures agents that already exist.
Grouping the two install kinds and leaving Skills last reads better than
stacking Systems third by default.

Hidden outright below `creator` rather than shown-and-disabled — a browse
surface gains nothing from a dead panel — and the jump anchor is gated with it,
so the nav can never point at a section that is not rendered.

Also in this merge:
- Kept dev's shared `api` client; did NOT reintroduce the raw `axios` import my
  side still carried (Invariant #7 moved underneath this branch).
- e2e retargeted from the tab strip to the section, plus a new assertion that
  `/templates#systems` still redirects with the hash intact — that legacy hop is
  what older links land on.
- Docs realigned across architecture, requirements, both flows and the user
  guide; the ent#263 page flow (`library-page.md`) gains the third section and
  records that tabs stay rejected.
- learnings.md and the feature-flows index took both sides.

The design question this raises — whether a fleet installer belongs on a browse
page at all — is deliberately left for review rather than settled here.

Full unit suite on the merged tree: 6173 passed, 14 skipped, 1 xfailed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants