syntaur 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/bin/syntaur.js +2 -0
- package/dashboard/dist/assets/_basePickBy-C-VS6QEr.js +1 -0
- package/dashboard/dist/assets/_baseUniq-Dfp0h_kE.js +1 -0
- package/dashboard/dist/assets/arc-DMAuseMg.js +1 -0
- package/dashboard/dist/assets/architectureDiagram-2XIMDMQ5-DERw9YH7.js +36 -0
- package/dashboard/dist/assets/blockDiagram-WCTKOSBZ-CVhoUGyp.js +132 -0
- package/dashboard/dist/assets/c4Diagram-IC4MRINW-B97ce7q3.js +10 -0
- package/dashboard/dist/assets/channel-BFnz84Fk.js +1 -0
- package/dashboard/dist/assets/chunk-4BX2VUAB-C-Tm8s7l.js +1 -0
- package/dashboard/dist/assets/chunk-55IACEB6-DTLywdgN.js +1 -0
- package/dashboard/dist/assets/chunk-FMBD7UC4-CZe3jJBW.js +15 -0
- package/dashboard/dist/assets/chunk-JSJVCQXG-DCDIzNBU.js +1 -0
- package/dashboard/dist/assets/chunk-KX2RTZJC-Dny_iTMP.js +1 -0
- package/dashboard/dist/assets/chunk-NQ4KR5QH-BVkniaFi.js +220 -0
- package/dashboard/dist/assets/chunk-QZHKN3VN-Yiy-DBy_.js +1 -0
- package/dashboard/dist/assets/chunk-WL4C6EOR-BZ6Aii8B.js +189 -0
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-9i4eMNgh.js +1 -0
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-9i4eMNgh.js +1 -0
- package/dashboard/dist/assets/clone-BQWw0UR0.js +1 -0
- package/dashboard/dist/assets/cose-bilkent-S5V4N54A-p-FSX7Hd.js +1 -0
- package/dashboard/dist/assets/cytoscape.esm-BQaXIfA_.js +331 -0
- package/dashboard/dist/assets/dagre-KLK3FWXG-JGHXC_Z-.js +4 -0
- package/dashboard/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dashboard/dist/assets/diagram-E7M64L7V-BMj79nA2.js +24 -0
- package/dashboard/dist/assets/diagram-IFDJBPK2-DvE6Hc7-.js +43 -0
- package/dashboard/dist/assets/diagram-P4PSJMXO-xVL3uMJs.js +24 -0
- package/dashboard/dist/assets/erDiagram-INFDFZHY-HAM6d8j_.js +70 -0
- package/dashboard/dist/assets/flowDiagram-PKNHOUZH-DPorMsV0.js +162 -0
- package/dashboard/dist/assets/ganttDiagram-A5KZAMGK-BxesGLxK.js +292 -0
- package/dashboard/dist/assets/gitGraphDiagram-K3NZZRJ6-tjaHpiMU.js +65 -0
- package/dashboard/dist/assets/graph-DAyh4Dby.js +1 -0
- package/dashboard/dist/assets/index-BnqH-RIk.css +1 -0
- package/dashboard/dist/assets/index-C1augJ5N.js +440 -0
- package/dashboard/dist/assets/infoDiagram-LFFYTUFH-MekJE5ZF.js +2 -0
- package/dashboard/dist/assets/init-Gi6I4Gst.js +1 -0
- package/dashboard/dist/assets/ishikawaDiagram-PHBUUO56-DovIBmaF.js +70 -0
- package/dashboard/dist/assets/journeyDiagram-4ABVD52K-CZw0QfY4.js +139 -0
- package/dashboard/dist/assets/kanban-definition-K7BYSVSG-Bl-d4Lb6.js +89 -0
- package/dashboard/dist/assets/katex-B1X10hvy.js +261 -0
- package/dashboard/dist/assets/layout-Ds5A52wn.js +1 -0
- package/dashboard/dist/assets/linear-FqOeAEKI.js +1 -0
- package/dashboard/dist/assets/mermaid.core-C7JSt2gc.js +255 -0
- package/dashboard/dist/assets/mindmap-definition-YRQLILUH-D6x3mID9.js +68 -0
- package/dashboard/dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dashboard/dist/assets/pieDiagram-SKSYHLDU-CnElBd0K.js +30 -0
- package/dashboard/dist/assets/quadrantDiagram-337W2JSQ-Q08fuvGB.js +7 -0
- package/dashboard/dist/assets/requirementDiagram-Z7DCOOCP-BImzzV5r.js +73 -0
- package/dashboard/dist/assets/sankeyDiagram-WA2Y5GQK-BIfD481p.js +10 -0
- package/dashboard/dist/assets/sequenceDiagram-2WXFIKYE-BS_1aSDE.js +145 -0
- package/dashboard/dist/assets/stateDiagram-RAJIS63D-Br1E8nkw.js +1 -0
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-rZTWN-vQ.js +1 -0
- package/dashboard/dist/assets/timeline-definition-YZTLITO2-DQJ_O-WU.js +61 -0
- package/dashboard/dist/assets/treemap-KZPCXAKY-BmmUp0Cf.js +162 -0
- package/dashboard/dist/assets/vennDiagram-LZ73GAT5-DzQooghy.js +34 -0
- package/dashboard/dist/assets/xychartDiagram-JWTSCODW-W9j8X9K6.js +7 -0
- package/dashboard/dist/index.html +17 -0
- package/dist/dashboard/server.d.ts +15 -0
- package/dist/dashboard/server.js +5873 -0
- package/dist/dashboard/server.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8892 -0
- package/dist/index.js.map +1 -0
- package/examples/playbooks/commit-discipline.md +20 -0
- package/examples/playbooks/keep-records-updated.md +30 -0
- package/examples/playbooks/plan-versioning.md +36 -0
- package/examples/playbooks/read-before-plan.md +27 -0
- package/examples/playbooks/test-before-done.md +24 -0
- package/examples/playbooks/workspace-before-code.md +30 -0
- package/examples/sample-mission/_index-assignments.md +20 -0
- package/examples/sample-mission/_index-decisions.md +11 -0
- package/examples/sample-mission/_index-plans.md +12 -0
- package/examples/sample-mission/_status.md +47 -0
- package/examples/sample-mission/agent.md +33 -0
- package/examples/sample-mission/assignments/design-auth-schema/assignment.md +61 -0
- package/examples/sample-mission/assignments/design-auth-schema/decision-record.md +15 -0
- package/examples/sample-mission/assignments/design-auth-schema/handoff.md +31 -0
- package/examples/sample-mission/assignments/design-auth-schema/plan.md +31 -0
- package/examples/sample-mission/assignments/design-auth-schema/scratchpad.md +40 -0
- package/examples/sample-mission/assignments/implement-jwt-middleware/assignment.md +65 -0
- package/examples/sample-mission/assignments/implement-jwt-middleware/decision-record.md +15 -0
- package/examples/sample-mission/assignments/implement-jwt-middleware/handoff.md +9 -0
- package/examples/sample-mission/assignments/implement-jwt-middleware/plan.md +33 -0
- package/examples/sample-mission/assignments/implement-jwt-middleware/scratchpad.md +48 -0
- package/examples/sample-mission/assignments/write-auth-tests/assignment.md +54 -0
- package/examples/sample-mission/assignments/write-auth-tests/decision-record.md +9 -0
- package/examples/sample-mission/assignments/write-auth-tests/handoff.md +9 -0
- package/examples/sample-mission/assignments/write-auth-tests/plan.md +34 -0
- package/examples/sample-mission/assignments/write-auth-tests/scratchpad.md +8 -0
- package/examples/sample-mission/claude.md +13 -0
- package/examples/sample-mission/manifest.md +22 -0
- package/examples/sample-mission/memories/_index.md +11 -0
- package/examples/sample-mission/memories/postgres-connection-pooling.md +35 -0
- package/examples/sample-mission/mission.md +34 -0
- package/examples/sample-mission/resources/_index.md +11 -0
- package/examples/sample-mission/resources/auth-requirements.md +44 -0
- package/package.json +57 -0
- package/plugin/.claude-plugin/plugin.json +9 -0
- package/plugin/agents/syntaur-expert.md +393 -0
- package/plugin/commands/track-server/track-server.md +56 -0
- package/plugin/commands/track-session/track-session.md +65 -0
- package/plugin/hooks/enforce-boundaries.sh +135 -0
- package/plugin/hooks/hooks.json +27 -0
- package/plugin/hooks/session-cleanup.sh +74 -0
- package/plugin/references/file-ownership.md +51 -0
- package/plugin/references/protocol-summary.md +70 -0
- package/plugin/skills/complete-assignment/SKILL.md +137 -0
- package/plugin/skills/create-assignment/SKILL.md +64 -0
- package/plugin/skills/create-mission/SKILL.md +51 -0
- package/plugin/skills/grab-assignment/SKILL.md +180 -0
- package/plugin/skills/plan-assignment/SKILL.md +101 -0
- package/plugin/skills/syntaur-protocol/SKILL.md +72 -0
- package/plugins/syntaur/.codex-plugin/plugin.json +28 -0
- package/plugins/syntaur/agents/openai.yaml +7 -0
- package/plugins/syntaur/agents/syntaur-operator.md +127 -0
- package/plugins/syntaur/commands/track-session.md +27 -0
- package/plugins/syntaur/hooks.json +27 -0
- package/plugins/syntaur/references/file-ownership.md +51 -0
- package/plugins/syntaur/references/protocol-summary.md +66 -0
- package/plugins/syntaur/scripts/enforce-boundaries.sh +103 -0
- package/plugins/syntaur/scripts/session-cleanup.sh +39 -0
- package/plugins/syntaur/skills/complete-assignment/SKILL.md +63 -0
- package/plugins/syntaur/skills/create-assignment/SKILL.md +43 -0
- package/plugins/syntaur/skills/create-mission/SKILL.md +35 -0
- package/plugins/syntaur/skills/grab-assignment/SKILL.md +61 -0
- package/plugins/syntaur/skills/plan-assignment/SKILL.md +49 -0
- package/plugins/syntaur/skills/syntaur-protocol/SKILL.md +84 -0
- package/plugins/syntaur/skills/track-session/SKILL.md +49 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: d1e2f3a4-b5c6-7890-abcd-333333333333
|
|
3
|
+
slug: write-auth-tests
|
|
4
|
+
title: Write Auth System Tests
|
|
5
|
+
status: pending
|
|
6
|
+
priority: medium
|
|
7
|
+
created: "2026-03-15T09:30:00Z"
|
|
8
|
+
updated: "2026-03-15T09:30:00Z"
|
|
9
|
+
assignee: null
|
|
10
|
+
externalIds: []
|
|
11
|
+
dependsOn:
|
|
12
|
+
- implement-jwt-middleware
|
|
13
|
+
blockedReason: null
|
|
14
|
+
workspace:
|
|
15
|
+
repository: null
|
|
16
|
+
worktreePath: null
|
|
17
|
+
branch: null
|
|
18
|
+
parentBranch: null
|
|
19
|
+
tags: []
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Write Auth System Tests
|
|
23
|
+
|
|
24
|
+
## Objective
|
|
25
|
+
|
|
26
|
+
Write comprehensive unit and integration tests for the authentication system, covering the database schema, JWT middleware, token flows, and edge cases. Target 80%+ code coverage.
|
|
27
|
+
|
|
28
|
+
## Acceptance Criteria
|
|
29
|
+
|
|
30
|
+
- [ ] Unit tests for JWT generation and validation utilities
|
|
31
|
+
- [ ] Unit tests for authentication middleware (mocked DB)
|
|
32
|
+
- [ ] Integration tests for login, signup, refresh, and logout endpoints
|
|
33
|
+
- [ ] Integration tests for role-based access control
|
|
34
|
+
- [ ] Edge case tests: expired tokens, revoked sessions, refresh token reuse detection
|
|
35
|
+
- [ ] Coverage report showing 80%+ line coverage
|
|
36
|
+
|
|
37
|
+
## Context
|
|
38
|
+
|
|
39
|
+
This assignment depends on [implement-jwt-middleware](../implement-jwt-middleware/assignment.md) being completed. Tests will cover both the schema layer (from design-auth-schema) and the middleware/endpoint layer (from implement-jwt-middleware). Use Jest as the test framework with `supertest` for HTTP integration tests.
|
|
40
|
+
|
|
41
|
+
## Questions & Answers
|
|
42
|
+
|
|
43
|
+
No questions yet.
|
|
44
|
+
|
|
45
|
+
## Progress
|
|
46
|
+
|
|
47
|
+
No progress yet.
|
|
48
|
+
|
|
49
|
+
## Links
|
|
50
|
+
|
|
51
|
+
- [Plan](./plan.md)
|
|
52
|
+
- [Scratchpad](./scratchpad.md)
|
|
53
|
+
- [Handoff](./handoff.md)
|
|
54
|
+
- [Decision Record](./decision-record.md)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
assignment: write-auth-tests
|
|
3
|
+
status: draft
|
|
4
|
+
created: "2026-03-15T09:30:00Z"
|
|
5
|
+
updated: "2026-03-15T09:30:00Z"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Plan: Write Auth System Tests
|
|
9
|
+
|
|
10
|
+
## Approach
|
|
11
|
+
|
|
12
|
+
Write a layered test suite: unit tests for isolated functions (JWT utils, middleware with mocked dependencies), integration tests for full endpoint flows (login, signup, refresh, logout), and edge case tests for security-critical paths (token expiry, revocation, refresh reuse).
|
|
13
|
+
|
|
14
|
+
## Tasks
|
|
15
|
+
|
|
16
|
+
- [ ] Set up test infrastructure (Jest config, test database, fixtures)
|
|
17
|
+
- [ ] Unit tests for `generateAccessToken` and `generateRefreshToken`
|
|
18
|
+
- [ ] Unit tests for `verifyToken` with valid, expired, and malformed tokens
|
|
19
|
+
- [ ] Unit tests for `authenticateToken` middleware with mocked DB
|
|
20
|
+
- [ ] Unit tests for `requireRole` middleware
|
|
21
|
+
- [ ] Integration tests for `POST /auth/signup` (happy path, duplicate email, weak password)
|
|
22
|
+
- [ ] Integration tests for `POST /auth/login` (happy path, wrong password, nonexistent user)
|
|
23
|
+
- [ ] Integration tests for `POST /auth/refresh` (happy path, expired token, reused token)
|
|
24
|
+
- [ ] Integration tests for `POST /auth/logout` (revokes session and token family)
|
|
25
|
+
- [ ] Integration tests for role-based route protection
|
|
26
|
+
- [ ] Generate and verify coverage report
|
|
27
|
+
|
|
28
|
+
## Risks & Mitigations
|
|
29
|
+
|
|
30
|
+
| Risk | Mitigation |
|
|
31
|
+
|------|------------|
|
|
32
|
+
| Test database setup complexity | Use Docker Compose for isolated PostgreSQL instance; reset between test suites |
|
|
33
|
+
| Flaky tests from timing-dependent JWT expiry | Use deterministic clock mocking with Jest fake timers |
|
|
34
|
+
| Incomplete coverage of edge cases | Review OWASP auth testing checklist before writing tests |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Claude Code Instructions — build-auth-system
|
|
2
|
+
|
|
3
|
+
Read `agent.md` first for universal conventions and boundaries.
|
|
4
|
+
|
|
5
|
+
## Additional Claude Code Rules
|
|
6
|
+
|
|
7
|
+
- When creating new files, always add them to the appropriate barrel export (`index.ts`)
|
|
8
|
+
- Run `npm run typecheck` after making changes to catch type errors early
|
|
9
|
+
- Use `npm test -- --watch` during development for fast feedback
|
|
10
|
+
- Prefer explicit type annotations on function signatures over inference
|
|
11
|
+
- When writing SQL migrations, name files with sequential numbering: `001_create_users.sql`, `002_create_sessions.sql`, etc.
|
|
12
|
+
- Commit frequently with descriptive messages referencing the assignment slug
|
|
13
|
+
- If you encounter a question you cannot resolve from existing context, add it to the Q&A section of your assignment.md and continue working on other tasks — the unanswered question will surface through `_status.md` needsAttention. Do NOT set status to `blocked` for unanswered questions; `blocked` is reserved for hard runtime/manual blockers.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: "1.0"
|
|
3
|
+
mission: build-auth-system
|
|
4
|
+
generated: "2026-03-18T14:30:00Z"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Mission: build-auth-system
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
- [Mission Overview](./mission.md)
|
|
11
|
+
|
|
12
|
+
## Indexes
|
|
13
|
+
- [Assignments](./_index-assignments.md)
|
|
14
|
+
- [Plans](./_index-plans.md)
|
|
15
|
+
- [Decision Records](./_index-decisions.md)
|
|
16
|
+
- [Status](./_status.md)
|
|
17
|
+
- [Resources](./resources/_index.md)
|
|
18
|
+
- [Memories](./memories/_index.md)
|
|
19
|
+
|
|
20
|
+
## Config
|
|
21
|
+
- [Agent Instructions](./agent.md)
|
|
22
|
+
- [Claude Code Instructions](./claude.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
mission: build-auth-system
|
|
3
|
+
generated: "2026-03-18T14:30:00Z"
|
|
4
|
+
total: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Memories
|
|
8
|
+
|
|
9
|
+
| Name | Source | Scope | Source Assignment | Updated |
|
|
10
|
+
|------|--------|-------|------------------|---------|
|
|
11
|
+
| [postgres-connection-pooling](./postgres-connection-pooling.md) | claude-2 | mission | design-auth-schema | 2026-03-17T09:00:00Z |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: memory
|
|
3
|
+
name: PostgreSQL Connection Pooling
|
|
4
|
+
source: claude-2
|
|
5
|
+
sourceAssignment: design-auth-schema
|
|
6
|
+
relatedAssignments:
|
|
7
|
+
- design-auth-schema
|
|
8
|
+
- implement-jwt-middleware
|
|
9
|
+
scope: mission
|
|
10
|
+
created: "2026-03-17T09:00:00Z"
|
|
11
|
+
updated: "2026-03-17T09:00:00Z"
|
|
12
|
+
tags:
|
|
13
|
+
- postgresql
|
|
14
|
+
- performance
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# PostgreSQL Connection Pooling
|
|
18
|
+
|
|
19
|
+
## Context
|
|
20
|
+
|
|
21
|
+
During schema design and migration testing, discovered that the default `pg` driver behavior of creating a new connection per query causes significant overhead under load. This is especially relevant for the auth system where every protected request hits the database to check session validity.
|
|
22
|
+
|
|
23
|
+
## Learnings
|
|
24
|
+
|
|
25
|
+
1. **Use `pg.Pool` instead of `pg.Client`:** The Pool manages a set of reusable connections. Set `max: 20` to match the non-functional requirement. The pool handles connection checkout, return, and idle timeout automatically.
|
|
26
|
+
|
|
27
|
+
2. **Set `idleTimeoutMillis: 30000`:** Connections idle for more than 30 seconds are closed. This prevents holding connections during low-traffic periods while keeping them warm during bursts.
|
|
28
|
+
|
|
29
|
+
3. **Set `connectionTimeoutMillis: 5000`:** If no connection is available within 5 seconds, fail fast rather than queue indefinitely. The auth middleware should return 503 in this case.
|
|
30
|
+
|
|
31
|
+
4. **Pool per service, not per request:** Create the pool once at application startup and share it across all routes. Confirmed that `pg.Pool` is safe for concurrent use.
|
|
32
|
+
|
|
33
|
+
## Recommendation
|
|
34
|
+
|
|
35
|
+
Add pool configuration to the service initialization code before the JWT middleware work begins. The middleware will need the pool for session lookups on every authenticated request.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
|
|
3
|
+
slug: build-auth-system
|
|
4
|
+
title: Build Authentication System
|
|
5
|
+
archived: false
|
|
6
|
+
archivedAt: null
|
|
7
|
+
archivedReason: null
|
|
8
|
+
created: "2026-03-15T09:00:00Z"
|
|
9
|
+
updated: "2026-03-15T09:00:00Z"
|
|
10
|
+
externalIds:
|
|
11
|
+
- system: jira
|
|
12
|
+
id: AUTH-42
|
|
13
|
+
url: https://jira.example.com/browse/AUTH-42
|
|
14
|
+
tags: []
|
|
15
|
+
workspace: sample-project
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Build Authentication System
|
|
19
|
+
|
|
20
|
+
## Overview
|
|
21
|
+
|
|
22
|
+
Build a complete authentication system for the auth-service backend. This includes designing the PostgreSQL schema for users, sessions, and tokens, implementing JWT-based middleware for route protection using RS256 signing, and writing comprehensive integration and unit tests.
|
|
23
|
+
|
|
24
|
+
The system must support:
|
|
25
|
+
- User registration and login with email/password
|
|
26
|
+
- JWT access tokens (short-lived) and refresh tokens (long-lived)
|
|
27
|
+
- Session management with revocation support
|
|
28
|
+
- Role-based access control (RBAC) with admin and user roles
|
|
29
|
+
|
|
30
|
+
Success looks like: all auth endpoints are functional, middleware protects routes correctly, token refresh flow works end-to-end, and test coverage exceeds 80%.
|
|
31
|
+
|
|
32
|
+
## Notes
|
|
33
|
+
|
|
34
|
+
The auth service is a greenfield project. We are using Express.js with TypeScript on Node 20. PostgreSQL 16 is the datastore. The team decided to use RS256 for JWT signing to support future key rotation without service restarts.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
mission: build-auth-system
|
|
3
|
+
generated: "2026-03-18T14:30:00Z"
|
|
4
|
+
total: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Resources
|
|
8
|
+
|
|
9
|
+
| Name | Category | Source | Related Assignments | Updated |
|
|
10
|
+
|------|----------|--------|---------------------|---------|
|
|
11
|
+
| [auth-requirements](./auth-requirements.md) | documentation | human | design-auth-schema, implement-jwt-middleware | 2026-03-15T09:00:00Z |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource
|
|
3
|
+
name: Auth Requirements
|
|
4
|
+
source: human
|
|
5
|
+
category: documentation
|
|
6
|
+
sourceUrl: null
|
|
7
|
+
sourceAssignment: null
|
|
8
|
+
relatedAssignments:
|
|
9
|
+
- design-auth-schema
|
|
10
|
+
- implement-jwt-middleware
|
|
11
|
+
created: "2026-03-15T09:00:00Z"
|
|
12
|
+
updated: "2026-03-15T09:00:00Z"
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Auth Requirements
|
|
16
|
+
|
|
17
|
+
## Functional Requirements
|
|
18
|
+
|
|
19
|
+
1. **User Registration:** Users can create an account with email and password. Emails must be unique. Passwords must be at least 12 characters with at least one uppercase, one lowercase, and one number.
|
|
20
|
+
|
|
21
|
+
2. **User Login:** Users can authenticate with email and password. Returns a JWT access token (30-minute TTL) and a refresh token (7-day TTL).
|
|
22
|
+
|
|
23
|
+
3. **Token Refresh:** Clients can exchange a valid refresh token for a new access/refresh token pair. Old refresh tokens are invalidated on use (rotation). If a previously-used refresh token is presented, revoke the entire token family (theft detection).
|
|
24
|
+
|
|
25
|
+
4. **Logout:** Revokes the current session and all associated refresh tokens.
|
|
26
|
+
|
|
27
|
+
5. **Protected Routes:** All API routes except `/auth/login`, `/auth/signup`, and `/auth/refresh` require a valid JWT access token in the `Authorization: Bearer <token>` header.
|
|
28
|
+
|
|
29
|
+
6. **Role-Based Access:** Two roles: `user` and `admin`. Certain endpoints (user management, system config) require `admin` role.
|
|
30
|
+
|
|
31
|
+
## Security Requirements
|
|
32
|
+
|
|
33
|
+
- Passwords hashed with bcrypt (cost factor 12)
|
|
34
|
+
- JWT signed with RS256 (asymmetric keys)
|
|
35
|
+
- No sensitive data in JWT payload (no email, no password hash)
|
|
36
|
+
- Refresh tokens stored as hashes in database (not plaintext)
|
|
37
|
+
- Rate limiting on auth endpoints: 10 requests per minute per IP
|
|
38
|
+
- All auth errors return generic messages (do not leak whether email exists)
|
|
39
|
+
|
|
40
|
+
## Non-Functional Requirements
|
|
41
|
+
|
|
42
|
+
- Auth endpoints respond within 200ms p95 under normal load
|
|
43
|
+
- Support 1000 concurrent authenticated sessions
|
|
44
|
+
- Database connection pooling with max 20 connections
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "syntaur",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI scaffolding tool for the Syntaur protocol",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"syntaur": "./bin/syntaur.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"bin",
|
|
13
|
+
".agents",
|
|
14
|
+
"plugins",
|
|
15
|
+
"plugin",
|
|
16
|
+
"examples",
|
|
17
|
+
"dashboard/dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsup",
|
|
21
|
+
"build:dashboard": "npm run build && npm run build --prefix dashboard",
|
|
22
|
+
"dev": "tsup --watch",
|
|
23
|
+
"dev:dashboard": "cd dashboard && npm run dev",
|
|
24
|
+
"dashboard:install": "cd dashboard && npm install",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
28
|
+
"prepublishOnly": "npm run build && npm ci --prefix dashboard && npm run build --prefix dashboard"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=20.0.0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"better-sqlite3": "^11.0.0",
|
|
35
|
+
"chokidar": "^4.0.0",
|
|
36
|
+
"commander": "^13.0.0",
|
|
37
|
+
"express": "^5.0.1",
|
|
38
|
+
"fuse.js": "^7.1.0",
|
|
39
|
+
"ink": "^6.8.0",
|
|
40
|
+
"ink-text-input": "^6.0.0",
|
|
41
|
+
"open": "^10.0.0",
|
|
42
|
+
"react": "^19.2.4",
|
|
43
|
+
"ws": "^8.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/better-sqlite3": "^7.6.0",
|
|
47
|
+
"@types/express": "^5.0.6",
|
|
48
|
+
"@types/node": "^20.0.0",
|
|
49
|
+
"@types/react": "^19.2.14",
|
|
50
|
+
"@types/ws": "^8.0.0",
|
|
51
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
52
|
+
"tsup": "^8.0.0",
|
|
53
|
+
"typescript": "^5.7.0",
|
|
54
|
+
"vite": "^8.0.1",
|
|
55
|
+
"vitest": "^3.0.0"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "syntaur",
|
|
3
|
+
"description": "Syntaur protocol adapter for Claude Code. Provides skills for grabbing, planning, and completing assignments, plus write boundary enforcement via hooks.",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Brennen",
|
|
6
|
+
"email": ""
|
|
7
|
+
},
|
|
8
|
+
"version": "0.1.0"
|
|
9
|
+
}
|