Commit graph

640 commits

Author SHA1 Message Date
2f5e0ea189 [nexus] fix: restore upstream delegation and fact-extraction content lost during rebase 2026-04-02 15:08:50 +00:00
2e9470be62 feat(12-01): ratings routes, community ratings in fetcher, list/getById JOIN, heartbeat hook
- Add POST/GET /skill-registry/skills/:sourceId/:slug/ratings routes
- Import skillRatingService in skill-registry routes
- Add upsertCommunityRatingsStub() in fetcher, called after each skill upsert
- Import communityRatings from schema in fetcher
- Update list() and getById() in skill-registry.ts to LEFT JOIN communityRatings
- Include averageRating, ratingCount, taskCount, avgCostUsd, lastUsedAt in SkillListItem
- Add agentSkills usage aggregation via LEFT JOIN + SUM/AVG/MAX
- Add fire-and-forget recordUsageForAgent call in heartbeat after finalizeAgentStatus
- Dynamic import keeps skill-registry-ratings off critical startup path
- All 44 skill-registry tests pass, full server suite (536) green
2026-04-02 15:08:50 +00:00
b7dddfa266 feat(12-01): personalRatings schema, DB DDL, skillRatingService, and tests
- Add personalRatings table to skill-registry-schema.ts
- Add taskCount, avgCostUsd, lastUsedAt columns to agentSkills in schema
- Add CREATE_PERSONAL_RATINGS_TABLE DDL constant in skill-registry-db.ts
- Add ALTER TABLE statements for new agent_skills usage columns (idempotent)
- Create skill-registry-ratings.ts with skillRatingService factory
- rate() appends personal rating, validates stars 1-5
- getRatings() returns ratings ordered by createdAt DESC
- recordUsageForAgent() atomically updates task_count, avg_cost_usd, last_used_at
- All 8 tests pass
2026-04-02 15:08:50 +00:00
12cab29630 fix(11): default agentSkillsDir server-side — GROUP-03/GROUP-04 gap closure 2026-04-02 15:08:50 +00:00
ed87cc721f feat(11-03): add skill group routes, mount in app.ts, startup reconciliation
- Create server/src/routes/skill-registry-groups.ts with skillGroupRoutes() factory
- All 14 REST routes for group CRUD, members, export/import, and agent assignments
- Import route registered before :groupId param to avoid route collision
- assertBoard on every handler, error classification (400/404/409/500)
- Mount skillGroupRoutes() in app.ts after skillRegistryRoutes()
- Add pendingSkillGroups fire-and-forget reconciliation in index.ts startup
2026-04-02 15:08:50 +00:00
bebacf5406 feat(11-02): skillGroupService() with CRUD, membership, inheritance, assignment, import/export
- Group CRUD: listGroups, getGroup, createGroup, updateGroup, deleteGroup (guards built-in)
- Member management: addMember, removeMember, listMembers
- Inheritance: addParent (with cycle detection BFS), removeParent, listParents
- resolveEffectiveSkills: BFS walk with visited-set guard for cycle safety
- assignGroup: installs all effective skills, tracks in agent_skills, returns installed/skipped/pendingPlugin
- removeGroup: set-difference uninstall with fs.rm() for file removal (not skillRegistryService.uninstall)
- listAgentGroups, listAgentSkills, getAgentEffectiveSkills
- exportGroup / importGroup: GroupExport v1 JSON with cycle check on import
2026-04-02 15:08:50 +00:00
0294ccdd29 feat(11-01): add group table DDL and built-in group seeding to skill-registry-db
- Import LibSQLClient type for seedBuiltinGroups parameter typing
- Add DDL constants for 5 new tables: skill_groups, skill_group_members,
  skill_group_inheritance, agent_skill_groups, agent_skills
- Add BUILTIN_GROUPS constant with 5 entries (pm-essentials, engineer-core,
  frontend, backend, creative)
- Add seedBuiltinGroups() using INSERT OR IGNORE for idempotent seeding
- Extend getSkillRegistryDb() to execute all 5 new DDL statements and seed
2026-04-02 15:08:50 +00:00
3612b3ae66 feat(11-01): add five Drizzle table definitions for skill groups
- Add primaryKey import from drizzle-orm/sqlite-core
- Add skillGroups table with id, name, description, isBuiltin, timestamps
- Add skillGroupMembers junction table with composite PK (groupId, skillId)
- Add skillGroupInheritance table with composite PK (childGroupId, parentGroupId)
- Add agentSkillGroups table with composite PK (agentId, groupId)
- Add agentSkills table with composite PK (agentId, skillId)
2026-04-02 15:08:50 +00:00
96cb10748a feat(09-04): implement skill registry REST routes and mount in app.ts (GREEN)
- Create skillRegistryRoutes() factory with 6 endpoints
- GET /api/skill-registry/skills (list, includeRemoved support)
- GET /api/skill-registry/skills/:sourceId/:slug (single skill, 404 on missing)
- GET /api/skill-registry/skills/:sourceId/:slug/versions (version history)
- POST /api/skill-registry/fetch (trigger fetchAllSources)
- POST /api/skill-registry/skills/:sourceId/:slug/install (copy to agent dir)
- POST /api/skill-registry/skills/:sourceId/:slug/rollback (restore prior version)
- DELETE /api/skill-registry/skills/:sourceId/:slug (soft-delete)
- assertBoard auth guard on every route
- Mount skillRegistryRoutes() in app.ts after companySkillRoutes
- Update tests to use two-segment path params (sourceId/slug) for Express 5 compatibility
- All 12 route tests pass
2026-04-02 15:08:50 +00:00
323ab7ecd3 test(09-04): add failing tests for skill registry routes (RED)
- Tests for GET /api/skill-registry/skills (list, includeRemoved param)
- Tests for GET /api/skill-registry/skills/:id (found, 404)
- Tests for GET /api/skill-registry/skills/:id/versions
- Tests for POST /api/skill-registry/fetch
- Tests for POST /api/skill-registry/skills/:id/install (success, 400)
- Tests for POST /api/skill-registry/skills/:id/rollback (success, 400)
- Tests for DELETE /api/skill-registry/skills/:id
2026-04-02 15:08:50 +00:00
ff99723991 feat(09-03): wire skillRegistryService export and startup DB init
- Add skillRegistryService re-export to services/index.ts after companySkillService
- Add fire-and-forget skill registry DB init in server/src/index.ts after reconcile block
- Uses dynamic import to avoid adding libSQL to critical startup path
2026-04-02 15:08:50 +00:00
4ee53bd62a feat(09-03): implement skillRegistryService with install, uninstall, rollback, list
- install() copies cached files to agent .claude/skills/<slug>/ dir
- install() returns pending_plugin_install for skills with file kind=plugin
- uninstall() soft-deletes via removed_at timestamp
- rollback() restores prior version from cache and updates active_version_id
- list() filters soft-deleted by default; includeRemoved=true returns all
- fetchAll() delegates to fetchAllSources for multi-source refresh
2026-04-02 15:08:50 +00:00
fd55204e1d test(09-03): add failing tests for skillRegistryService install/rollback/uninstall/list 2026-04-02 15:08:50 +00:00
12de4a018f feat(09-02): implement multi-source skill fetcher with file caching
- SkillSourceConfig type + BUILT_IN_SOURCES (3 sources: anthropic, schwepps, daymade)
- fetchAllSources() fetches from anthropic-marketplace and github-tree source types
- parseSkillFrontmatter() extracts name/description from SKILL.md YAML blocks
- Idempotency: checks version exists before fetching, skips re-download on same SHA
- Caches SKILL.md to skills/cache/<skill-id>/<sha>/SKILL.md on disk
- Inserts skills, skill_versions, and skill_files rows into registry.db
- All 7 tests passing (TDD GREEN)
2026-04-02 15:08:50 +00:00
77b3180045 test(09-02): add failing tests for skill-registry-fetcher
- 7 tests covering fetch from Anthropic marketplace and GitHub tree sources
- Tests DB insertion, file caching, idempotency, and BUILT_IN_SOURCES config
- All tests fail with ERR_MODULE_NOT_FOUND (expected TDD RED state)
2026-04-02 15:08:50 +00:00
11f1ff2b7b feat(09-01): extract GitHub fetch helpers to shared module
- Create github-skill-helpers.ts with fetchText, fetchJson, resolveGitHubDefaultBranch, resolveGitHubCommitSha, parseGitHubSourceUrl, resolveGitHubPinnedRef, resolveRawGitHubUrl
- Update company-skills.ts to import from github-skill-helpers.js instead of defining locally
- All existing company-skill tests pass (15/15)
2026-04-02 15:08:50 +00:00
576fda3adc feat(09-01): install @libsql/client, schema, DB init, path helpers
- Install @libsql/client@^0.17.2 to server package
- Create skill-registry-schema.ts with 4 sqliteTable definitions (skills, skillVersions, skillFiles, communityRatings)
- Create skill-registry-db.ts with lazy singleton getSkillRegistryDb() and resetSkillRegistryDb()
- Add resolveSkillRegistryDbPath() and resolveSkillCacheDir() to home-paths.ts
- Add skill-registry-schema.test.ts with 8 passing tests (TDD green)
2026-04-02 15:08:38 +00:00
e80a419aff feat(08-02): add ensureGeneralistAgents startup migration for existing workspaces
- Import agentService and agents table into server/src/index.ts
- ensureGeneralistAgents() queries all companies, skips any that already have
  a general-role agent (idempotent), creates Generalist via agentService.create()
- metadata includes pendingSkillGroups: [Creative] and backfilled: true flag
- Called with fire-and-forget void pattern after ensureLocalTrustedBoardPrincipal
- Existing workspaces get Generalist on next server upgrade without user action
2026-04-02 15:08:38 +00:00
53dfd52b72 fix(08-02): update agent-skills-routes test expectations for rewritten bundles
[Rule 1 - Bug] Tests expected old upstream bundle content strings (You are the CEO.,
CEO Heartbeat Checklist, CEO Persona, Keep the work moving until it is done.)
but Phase 08-01 rewrote all CEO and engineer bundles with PM-focused content.
Updated assertions to match actual bundle output.
2026-04-02 15:08:38 +00:00
efca65cf08 feat(08-01): update PM routing rules to include Generalist delegation
- Add 'Copy, branding, research, legal, docs, presentations -> Generalist agent' routing rule
- Inserted between Engineer and Cross-functional rules in Delegation section
2026-04-02 15:08:38 +00:00
d3d042bff6 feat(08-01): add Generalist agent template bundle and wire role mapping
- Create server/src/onboarding-assets/general/ with 4 files (AGENTS.md, SOUL.md, HEARTBEAT.md, TOOLS.md)
- Add general role to DEFAULT_AGENT_BUNDLE_FILES with full 4-file bundle
- Add resolveDefaultAgentInstructionsBundleRole branch for general role
- Rename AGENT_ROLE_LABELS general from 'General' to 'Generalist'
2026-04-02 15:08:38 +00:00
8790e939c1 [nexus] fix(06): resolve verifier gaps — portability fallback, export readme, CLI company descriptions, server error msg 2026-04-02 15:08:37 +00:00
0281e7a6bf feat(06-03): TERM-18 grep audit — fix remaining display-zone corporate strings
- ui/src/App.tsx: Create/first company titles and descriptions → VOCAB.company
- ui/src/components/OnboardingWizard.tsx: 3 company display strings → VOCAB
- ui/src/components/Sidebar.tsx: 'Select company' fallback → VOCAB
- ui/src/pages/CliAuth.tsx: 'Requested company' label → VOCAB
- ui/src/pages/AgentDetail.tsx: company library string → VOCAB
- server/src/services/company-portability.ts: 'Imported Company' x2 → 'Imported Workspace'
- cli/src/commands/client/{issue,approval,agent,dashboard,activity}.ts: option descriptions → VOCAB
- cli/src/commands/worktree.ts: error message and option description → VOCAB
- server/src/index.ts: comment cleanup (actual value already 'Owner')
- server/src/services/company-export-readme.ts: comment cleanup (value already 'Project Manager')
2026-04-02 15:08:37 +00:00
9cb0e1a27b feat(04-01): register pm and engineer bundles in bundle registry
- Add pm and engineer entries to DEFAULT_AGENT_BUNDLE_FILES
- Update resolveDefaultAgentInstructionsBundleRole to handle pm and engineer roles
- DefaultAgentBundleRole type auto-includes new keys via keyof typeof
- All changes marked with // [nexus] for rebase visibility
2026-04-02 15:08:21 +00:00
2a20db297e feat(04-01): create PM and Engineer agent template bundles, rewrite CEO bundle
- Add server/src/onboarding-assets/pm/ with SOUL.md, AGENTS.md, HEARTBEAT.md, TOOLS.md
- Add server/src/onboarding-assets/engineer/ with SOUL.md, AGENTS.md, HEARTBEAT.md, TOOLS.md
- Rewrite server/src/onboarding-assets/ceo/ as PM-appropriate content with Nexus vocabulary
- All files use workspace/agent/Owner/Project Manager terminology
- Zero Paperclip, CEO, Hire, or Fire references in any template content
2026-04-02 15:08:21 +00:00
509b73d8fc fix(03-05): grep audit fixes — CEO→Project Manager in export readme, Board→Owner in local user, test assertion updates
- company-export-readme.ts: ROLE_LABELS ceo changed from 'CEO' to 'Project Manager' [nexus]
- server/index.ts: LOCAL_BOARD_USER_NAME changed from 'Board' to 'Owner' [nexus]
- cli/__tests__/company.test.ts: assertions updated to Workspace vocabulary
- cli/__tests__/http.test.ts: assertion updated to 'Nexus API' from 'Paperclip API'
- ui/OnboardingWizard.tsx: added explicit string type annotation for useState<string>
2026-04-02 15:08:11 +00:00
e23f59fc67 feat(02-01): replace PAPERCLIP ASCII art with NEXUS in banners
- Replace PAPERCLIP art with NEXUS art in server/src/startup-banner.ts
- Replace full cli/src/utils/banner.ts with NEXUS art and updated tagline
- Rename printPaperclipCliBanner to printNexusCliBanner
- Update tagline to 'Open-source orchestration for your agents'
- Update all 5 CLI command callers: onboard, configure, db-backup, worktree, doctor
- Satisfies BRND-02
2026-04-02 15:07:27 +00:00
b247678337 feat(02-02): update resolveDefaultAgentWorkspaceDir to use slugified agent names
- Change signature from (agentId: string) to (agent: { id: string; name?: string | null })
- Use sanitizeFriendlyPathSegment(name) for human-readable workspace dirs
- Fall back to sanitized id when name is empty/null
- Update all 4 call sites in heartbeat.ts with { id, name } objects
- Add agentName field to resolveRuntimeSessionParamsForWorkspace input type
- Update both test call sites in heartbeat-workspace-session.test.ts
2026-04-02 15:07:27 +00:00
cfad6f9f73 feat(02-02): add ~/.nexus pointer-file resolution to server and CLI home-paths
- Add resolveNexusPointerFile() helper to server/src/home-paths.ts
- Add resolveNexusPointerFile() helper to cli/src/config/home.ts
- Patch resolvePaperclipHomeDir() in both files: ~/.nexus > PAPERCLIP_HOME > ~/.paperclip
- Add import fs from node:fs to both files
2026-04-02 15:07:27 +00:00
Dotta
2c1883fc77
Merge pull request #2449 from statxc/feat/github-enterprise-url-support
feat: GitHub enterprise url support
2026-04-02 06:07:44 -05:00
Devin Foley
1e24e6e84c
fix: auto-detect default branch for worktree creation when baseRef not configured (#2463)
* fix: auto-detect default branch for worktree creation when baseRef not configured

When creating git worktrees, if no explicit baseRef is configured in
the project workspace strategy and no repoRef is set, the system now
auto-detects the repository's default branch instead of blindly
falling back to "HEAD".

Detection strategy:
1. Check refs/remotes/origin/HEAD (set by git clone / remote set-head)
2. Fall back to probing refs/remotes/origin/main, then origin/master
3. Final fallback: HEAD (preserves existing behavior)

This prevents failures like "fatal: invalid reference: main" when a
project's workspace strategy has no baseRef and the repo uses a
non-standard default branch name.

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix: address Greptile review - fix misleading comment and add symbolic-ref test

- Corrected comment to clarify that the existing test exercises the
  heuristic fallback path (not symbolic-ref)
- Added new test case that explicitly sets refs/remotes/origin/HEAD
  via `git remote set-head` to exercise the symbolic-ref code path

Co-Authored-By: Paperclip <noreply@paperclip.ing>

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-01 18:00:49 -07:00
statxc
9d89d74d70 refactor: rename URL validators to looksLikeRepoUrl 2026-04-01 23:21:22 +00:00
statxc
6a7830b07e fix: add HTTPS protocol check to server-side GitHub URL parsers 2026-04-01 21:27:10 +00:00
statxc
f9cebe9b73 fix: harden GHE URL detection and extract shared GitHub helpers 2026-04-01 21:05:48 +00:00
statxc
9e1ee925cd feat: support GitHub Enterprise URLs for skill and company imports 2026-04-01 20:53:41 +00:00
Dotta
6c2c63e0f1
Merge pull request #2328 from bittoby/fix/project-slug-collision
Fix: project slug collisions for non-English names (#2318)
2026-04-01 09:34:23 -05:00
bittoby
99296f95db fix: append short UUID suffix to project slugs when non-ASCII characters are stripped to prevent slug collisions 2026-03-31 16:35:30 +00:00
Cody (Radius Red)
ce8d9eb323 fix(server): preserve adapter-agnostic keys when changing adapter type
When the adapter type changes via PATCH, the server only preserved
instruction bundle keys (instructionsBundleMode, etc.) from the
existing config. Adapter-agnostic keys like env, cwd, timeoutSec,
graceSec, promptTemplate, and bootstrapPromptTemplate were silently
dropped if the PATCH payload didn't explicitly include them.

This caused env var data loss when adapter type was changed via the
UI or API without sending the full existing adapterConfig.

The fix preserves these adapter-agnostic keys from the existing config
before applying the instruction bundle preservation, matching the
UI's behavior in AgentConfigForm.handleSave.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-31 15:42:03 +00:00
Dotta
9f1bb350fe
Merge pull request #2065 from edimuj/fix/heartbeat-session-reuse
fix: preserve session continuity for timer/heartbeat wakes
2026-03-31 08:29:45 -05:00
dotta
41f261eaf5 Merge public-gh/master into PAP-881-document-revisions-bulid-it 2026-03-31 07:31:17 -05:00
Dotta
19aaa54ae4
Merge branch 'master' into add-gpt-5-4-xhigh-effort 2026-03-31 06:19:26 -05:00
Dotta
98337f5b03
Merge pull request #2203 from paperclipai/pap-1007-workspace-followups
fix: preserve workspace continuity across follow-up issues
2026-03-30 15:24:47 -05:00
dotta
477ef78fed Address Greptile feedback on workspace reuse
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 14:55:44 -05:00
dotta
5e65bb2b92 Add company name to invite summaries
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 14:14:14 -05:00
dotta
88e742a129 Fix health DB connectivity probe
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 14:14:14 -05:00
dotta
a3e125f796 Clarify Claude transcript event categories
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 14:13:52 -05:00
dotta
2b18fc4007 Repair server workspace package links in worktrees
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 14:10:36 -05:00
dotta
ec1210caaa Preserve workspaces for follow-up issues
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 14:10:36 -05:00
dotta
3c66683169 Fix execution workspace reuse and slugify worktrees
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 14:10:36 -05:00
dotta
4d61dbfd34 Merge public-gh/master into pap-979-runtime-workspaces
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 08:35:30 -05:00