feat: gated project experience & prompt intelligence

Implements the full gated session flow and prompt intelligence system:

- Prisma schema: add gated, priority, summary, chapters, linkTarget fields
- Session gate: state machine (gated → begin_session → ungated) with LLM-powered
  tool selection based on prompt index
- Tag matcher: intelligent prompt-to-tool matching with project/server/action tags
- LLM selector: tiered provider selection (fast for gating, heavy for complex tasks)
- Link resolver: cross-project MCP resource references (project/server:uri format)
- Prompt summary service: LLM-generated summaries and chapter extraction
- System project bootstrap: ensures default project exists on startup
- Structural link health checks: enrichWithLinkStatus on prompt GET endpoints
- CLI: create prompt --priority/--link, create project --gated/--no-gated,
  describe project shows prompts section, get prompts shows PRI/LINK/STATUS
- Apply/edit: priority, linkTarget, gated fields supported
- Shell completions: fish updated with new flags
- 1,253 tests passing across all packages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Michal
2026-02-25 23:22:42 +00:00
parent 3782bcf9d7
commit ecc9c48597
46 changed files with 4946 additions and 105 deletions

View File

@@ -47,7 +47,7 @@ describe('CLI command registration (e2e)', () => {
expect(subcommands).toContain('reset');
});
it('create command has user, group, rbac subcommands', () => {
it('create command has user, group, rbac, prompt, promptrequest subcommands', () => {
const program = createProgram();
const create = program.commands.find((c) => c.name() === 'create');
expect(create).toBeDefined();
@@ -59,6 +59,24 @@ describe('CLI command registration (e2e)', () => {
expect(subcommands).toContain('user');
expect(subcommands).toContain('group');
expect(subcommands).toContain('rbac');
expect(subcommands).toContain('prompt');
expect(subcommands).toContain('promptrequest');
});
it('get command accepts --project option', () => {
const program = createProgram();
const get = program.commands.find((c) => c.name() === 'get');
expect(get).toBeDefined();
const projectOpt = get!.options.find((o) => o.long === '--project');
expect(projectOpt).toBeDefined();
expect(projectOpt!.description).toContain('project');
});
it('program-level --project option is defined', () => {
const program = createProgram();
const projectOpt = program.options.find((o) => o.long === '--project');
expect(projectOpt).toBeDefined();
});
it('displays version', () => {