kata-context 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/.claude/settings.json +6 -0
- package/.github/dependabot.yml +13 -0
- package/.github/workflows/release.yml +68 -0
- package/.planning/PROJECT.md +103 -0
- package/.planning/REQUIREMENTS.md +61 -0
- package/.planning/ROADMAP.md +59 -0
- package/.planning/STATE.md +45 -0
- package/.planning/config.json +20 -0
- package/.planning/phases/01-foundation/01-01-PLAN.md +158 -0
- package/.planning/phases/01-foundation/01-01-SUMMARY.md +123 -0
- package/.planning/phases/01-foundation/01-02-PLAN.md +262 -0
- package/.planning/phases/01-foundation/01-02-SUMMARY.md +153 -0
- package/.planning/phases/01-foundation/01-RESEARCH.md +380 -0
- package/.planning/phases/01-foundation/01-foundation-VERIFICATION.md +232 -0
- package/.planning/research/ARCHITECTURE.md +601 -0
- package/.planning/research/FEATURES.md +242 -0
- package/.planning/research/PITFALLS.md +436 -0
- package/.planning/research/STACK.md +299 -0
- package/.planning/research/SUMMARY.md +409 -0
- package/README.md +82 -0
- package/biome.json +42 -0
- package/package.json +28 -0
- package/scripts/rescue-main.sh +79 -0
- package/src/index.ts +6 -0
- package/tsconfig.json +20 -0
- package/vitest.config.ts +14 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "npm"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
open-pull-requests-limit: 10
|
|
8
|
+
|
|
9
|
+
- package-ecosystem: "github-actions"
|
|
10
|
+
directory: "/"
|
|
11
|
+
schedule:
|
|
12
|
+
interval: "weekly"
|
|
13
|
+
open-pull-requests-limit: 5
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v6
|
|
16
|
+
|
|
17
|
+
- name: Setup Node.js
|
|
18
|
+
uses: actions/setup-node@v6
|
|
19
|
+
with:
|
|
20
|
+
node-version: '20'
|
|
21
|
+
registry-url: 'https://registry.npmjs.org'
|
|
22
|
+
|
|
23
|
+
- name: Get package info
|
|
24
|
+
id: package
|
|
25
|
+
run: |
|
|
26
|
+
LOCAL_VERSION=$(node -p "require('./package.json').version")
|
|
27
|
+
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
28
|
+
echo "local_version=$LOCAL_VERSION" >> $GITHUB_OUTPUT
|
|
29
|
+
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
|
|
30
|
+
|
|
31
|
+
# Get published version (returns empty if not published)
|
|
32
|
+
PUBLISHED_VERSION=$(npm view "$PACKAGE_NAME" version 2>/dev/null || echo "")
|
|
33
|
+
echo "published_version=$PUBLISHED_VERSION" >> $GITHUB_OUTPUT
|
|
34
|
+
|
|
35
|
+
echo "Local version: $LOCAL_VERSION"
|
|
36
|
+
echo "Published version: $PUBLISHED_VERSION"
|
|
37
|
+
|
|
38
|
+
- name: Check if should publish
|
|
39
|
+
id: check
|
|
40
|
+
run: |
|
|
41
|
+
LOCAL="${{ steps.package.outputs.local_version }}"
|
|
42
|
+
PUBLISHED="${{ steps.package.outputs.published_version }}"
|
|
43
|
+
|
|
44
|
+
if [ -z "$PUBLISHED" ]; then
|
|
45
|
+
echo "Package not yet published, will publish"
|
|
46
|
+
echo "should_publish=true" >> $GITHUB_OUTPUT
|
|
47
|
+
elif [ "$LOCAL" != "$PUBLISHED" ]; then
|
|
48
|
+
echo "Version changed ($PUBLISHED -> $LOCAL), will publish"
|
|
49
|
+
echo "should_publish=true" >> $GITHUB_OUTPUT
|
|
50
|
+
else
|
|
51
|
+
echo "Version unchanged ($LOCAL), skipping publish"
|
|
52
|
+
echo "should_publish=false" >> $GITHUB_OUTPUT
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
- name: Publish to npm
|
|
56
|
+
if: steps.check.outputs.should_publish == 'true'
|
|
57
|
+
run: npm publish --access public
|
|
58
|
+
env:
|
|
59
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
60
|
+
|
|
61
|
+
- name: Create GitHub Release
|
|
62
|
+
if: steps.check.outputs.should_publish == 'true'
|
|
63
|
+
uses: softprops/action-gh-release@v2
|
|
64
|
+
with:
|
|
65
|
+
tag_name: v${{ steps.package.outputs.local_version }}
|
|
66
|
+
name: v${{ steps.package.outputs.local_version }}
|
|
67
|
+
generate_release_notes: true
|
|
68
|
+
make_latest: true
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Kata Context
|
|
2
|
+
|
|
3
|
+
## What This Is
|
|
4
|
+
|
|
5
|
+
A standalone context policy engine for AI agents. Manages what goes in and out of the LLM context window — compaction, summarization, retrieval, and budget-aware windowing. Framework-agnostic infrastructure: works with any agent system, or none.
|
|
6
|
+
|
|
7
|
+
## Core Value
|
|
8
|
+
|
|
9
|
+
Given messages and a context budget, determine the optimal window to send to the model. Policy, not storage.
|
|
10
|
+
|
|
11
|
+
## Current Milestone: v0.1.0 Core Setup
|
|
12
|
+
|
|
13
|
+
**Goal:** Establish project foundation with TypeScript/Vercel scaffolding, linting, and testing infrastructure.
|
|
14
|
+
|
|
15
|
+
**Target features:**
|
|
16
|
+
- TypeScript project structure for Vercel serverless
|
|
17
|
+
- Linting configuration (ESLint, Prettier)
|
|
18
|
+
- Testing setup (Vitest or similar)
|
|
19
|
+
- Development workflow (scripts, environment)
|
|
20
|
+
|
|
21
|
+
## Requirements
|
|
22
|
+
|
|
23
|
+
### Validated
|
|
24
|
+
|
|
25
|
+
(None yet — ship to validate)
|
|
26
|
+
|
|
27
|
+
### Active
|
|
28
|
+
|
|
29
|
+
**Core Engine:**
|
|
30
|
+
- [ ] Versioned context storage with full history
|
|
31
|
+
- [ ] Basic compaction policy (configurable aggressiveness)
|
|
32
|
+
- [ ] Budget-aware windowing (fit within token limit)
|
|
33
|
+
- [ ] Context forking for exploration paths
|
|
34
|
+
- [ ] Time-travel (jump to any version)
|
|
35
|
+
|
|
36
|
+
**API & SDKs:**
|
|
37
|
+
- [ ] Framework-agnostic REST API
|
|
38
|
+
- [ ] Python SDK
|
|
39
|
+
- [ ] TypeScript SDK
|
|
40
|
+
|
|
41
|
+
**Storage:**
|
|
42
|
+
- [ ] PostgreSQL with pgvector
|
|
43
|
+
|
|
44
|
+
**Commercial MVP (1.0):**
|
|
45
|
+
- [ ] Hosted API on Vercel (serverless)
|
|
46
|
+
- [ ] Stripe integration for SaaS billing
|
|
47
|
+
- [ ] Multi-tenancy and access control
|
|
48
|
+
|
|
49
|
+
**Later:**
|
|
50
|
+
- [ ] Summarization with structured schemas
|
|
51
|
+
- [ ] Semantic retrieval for offloaded context (RAG)
|
|
52
|
+
- [ ] Advanced policies (custom rules, per-context configuration)
|
|
53
|
+
- [ ] Analytics and observability
|
|
54
|
+
|
|
55
|
+
### Out of Scope
|
|
56
|
+
|
|
57
|
+
- **Full agent framework** — We're infrastructure (Postgres), not framework (Rails). Use with any agent system.
|
|
58
|
+
- **Tool execution/sandboxing** — Orthogonal concern. Use whatever tool layer you want.
|
|
59
|
+
- **Agent orchestration** — Kata Orchestrator handles this. We're the context layer beneath it.
|
|
60
|
+
- **Opinionated agent patterns** — No opinion on how you build agents.
|
|
61
|
+
- **Letta fork/rebrand** — Fresh codebase. Study Letta for learnings, don't import code.
|
|
62
|
+
|
|
63
|
+
## Context
|
|
64
|
+
|
|
65
|
+
**Kata Ecosystem:**
|
|
66
|
+
Kata Context is one layer in a vertically integrated stack. Kata Orchestrator is the first customer — currently uses markdown files in `.planning/` for state persistence. Works but is brittle (manual edits break workflows, parsing markdown is fragile). Kata Context replaces this with proper context management.
|
|
67
|
+
|
|
68
|
+
**Why vertical integration:**
|
|
69
|
+
1. Real requirements — not guessing what developers need. We are the developer.
|
|
70
|
+
2. Proof of concept built-in — production multi-agent system running on Kata Context.
|
|
71
|
+
3. Forces good design — if the API is awkward for Kata, it'll be awkward for everyone.
|
|
72
|
+
|
|
73
|
+
**Prior Art:**
|
|
74
|
+
- Letta — Full agent framework with bundled memory. Learning source for context window calculation, summarization approaches. Not forking — context layer is coupled to their agent model.
|
|
75
|
+
- mem0, Zep — Similar space, but more opinionated. We're lower-level infrastructure.
|
|
76
|
+
|
|
77
|
+
**Competitive Positioning:**
|
|
78
|
+
The context layer you'd build yourself, but shouldn't have to. Infrastructure, not framework. Works with everything.
|
|
79
|
+
|
|
80
|
+
## Constraints
|
|
81
|
+
|
|
82
|
+
- **Tech stack**: Vercel ecosystem (serverless functions, Postgres via Neon with pgvector), TypeScript for server
|
|
83
|
+
- **SDKs**: Python and TypeScript required — these are what developers actually use
|
|
84
|
+
- **First customer**: Kata Orchestrator — API must support its workflows
|
|
85
|
+
- **Solo developer**: One person building, so scope must stay tight
|
|
86
|
+
- **Open source**: Public repo from day one, Apache 2.0 for core and SDKs
|
|
87
|
+
|
|
88
|
+
## Key Decisions
|
|
89
|
+
|
|
90
|
+
| Decision | Rationale | Outcome |
|
|
91
|
+
| -------- | --------- | ------- |
|
|
92
|
+
| Standalone layer, not framework | Larger market, cleaner differentiation, smaller surface area | — Pending |
|
|
93
|
+
| Fresh codebase, not Letta fork | Avoid rebrand complexity, build what we need | — Pending |
|
|
94
|
+
| Vercel serverless deployment | Simplicity, TypeScript-native, scales automatically | — Pending |
|
|
95
|
+
| PostgreSQL with pgvector | Battle-tested, embeddings built-in, Vercel Postgres available | — Pending |
|
|
96
|
+
| TypeScript for server | Vercel-native, faster iteration than Rust, good enough perf for MVP | — Pending |
|
|
97
|
+
| Open source from day one | Builds trust, consistency with other Kata projects, no awkward transition | — Pending |
|
|
98
|
+
| Local beta first, then hosted MVP | Validate with self as customer before commercializing | — Pending |
|
|
99
|
+
| Open core business model | Open source core for adoption, monetize hosted service | — Pending |
|
|
100
|
+
| Small milestones (1-3 phases) | Shippable in a day, maintain momentum | — Pending |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
*Last updated: 2025-01-29 after initialization*
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Requirements
|
|
2
|
+
|
|
3
|
+
## v0.1.0 Core Setup
|
|
4
|
+
|
|
5
|
+
### Project Initialization
|
|
6
|
+
|
|
7
|
+
- [x] **INIT-01**: TypeScript configured with `strict: true` and `NodeNext` module resolution
|
|
8
|
+
- [x] **INIT-02**: pnpm initialized as package manager with lock file
|
|
9
|
+
- [x] **INIT-03**: Package.json includes dev, build, test, lint, and format scripts
|
|
10
|
+
|
|
11
|
+
### Developer Tooling
|
|
12
|
+
|
|
13
|
+
- [x] **TOOL-01**: Biome configured for linting and formatting
|
|
14
|
+
- [x] **TOOL-02**: Vitest configured for TypeScript testing
|
|
15
|
+
- [ ] **TOOL-03**: Pre-commit hooks enforce lint and format via Husky + lint-staged
|
|
16
|
+
- [ ] **TOOL-04**: GitHub Actions CI runs lint and test on push/PR
|
|
17
|
+
|
|
18
|
+
### Vercel Setup
|
|
19
|
+
|
|
20
|
+
- [ ] **VERCEL-01**: `/api` directory structure for serverless functions
|
|
21
|
+
- [ ] **VERCEL-02**: Health check endpoint at `/api/health.ts` returns status
|
|
22
|
+
- [ ] **VERCEL-03**: Local `vercel build` succeeds without errors
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Future Requirements
|
|
27
|
+
|
|
28
|
+
(Deferred to later milestones)
|
|
29
|
+
|
|
30
|
+
- Database schema and connection (v0.2.0)
|
|
31
|
+
- TypeScript SDK package (v0.3.0)
|
|
32
|
+
- Python SDK package (v0.3.0)
|
|
33
|
+
- Multi-tenancy and access control (v1.0)
|
|
34
|
+
- Stripe integration (v1.0)
|
|
35
|
+
|
|
36
|
+
## Out of Scope
|
|
37
|
+
|
|
38
|
+
- **Docker configuration** — Vercel handles deployment; Docker adds complexity without value
|
|
39
|
+
- **Complex folder structures** — Keep it simple for scaffolding; evolve as needed
|
|
40
|
+
- **Full CD pipeline** — Manual deployment sufficient for v0.1.0; automate later
|
|
41
|
+
- **Database setup** — Separate milestone for storage layer
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Traceability
|
|
46
|
+
|
|
47
|
+
| Requirement | Phase | Status |
|
|
48
|
+
|-------------|-------|--------|
|
|
49
|
+
| INIT-01 | Phase 1 | Complete |
|
|
50
|
+
| INIT-02 | Phase 1 | Complete |
|
|
51
|
+
| INIT-03 | Phase 1 | Complete |
|
|
52
|
+
| TOOL-01 | Phase 1 | Complete |
|
|
53
|
+
| TOOL-02 | Phase 1 | Complete |
|
|
54
|
+
| TOOL-03 | Phase 2 | Pending |
|
|
55
|
+
| TOOL-04 | Phase 2 | Pending |
|
|
56
|
+
| VERCEL-01 | Phase 2 | Pending |
|
|
57
|
+
| VERCEL-02 | Phase 2 | Pending |
|
|
58
|
+
| VERCEL-03 | Phase 2 | Pending |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
*Generated: 2026-01-29*
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Roadmap
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
| Milestone | Phases | Status |
|
|
6
|
+
|-----------|--------|--------|
|
|
7
|
+
| v0.1.0 Core Setup | 1-2 | In Progress |
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
### v0.1.0 Core Setup (In Progress)
|
|
12
|
+
|
|
13
|
+
#### Phase 1: Foundation
|
|
14
|
+
|
|
15
|
+
**Goal**: Establish a working TypeScript development environment with linting, formatting, and testing.
|
|
16
|
+
|
|
17
|
+
**Dependencies**: None (first phase)
|
|
18
|
+
|
|
19
|
+
**Requirements**: INIT-01, INIT-02, INIT-03, TOOL-01, TOOL-02
|
|
20
|
+
|
|
21
|
+
**Plans:** 2 plans
|
|
22
|
+
|
|
23
|
+
Plans:
|
|
24
|
+
- [x] 01-01-PLAN.md — Initialize pnpm project with dependencies and .gitignore
|
|
25
|
+
- [x] 01-02-PLAN.md — Configure TypeScript, Biome, and Vitest tooling
|
|
26
|
+
|
|
27
|
+
**Success Criteria** (what must be TRUE when this phase completes):
|
|
28
|
+
1. Developer can run `pnpm install` and get all dependencies installed
|
|
29
|
+
2. Developer can run `pnpm lint` and `pnpm format` with Biome checking TypeScript files
|
|
30
|
+
3. Developer can run `pnpm test` and Vitest executes (even with no tests yet)
|
|
31
|
+
4. Developer can run `pnpm build` and TypeScript compiles with strict mode enabled
|
|
32
|
+
5. TypeScript module resolution uses `NodeNext` for Vercel compatibility
|
|
33
|
+
|
|
34
|
+
#### Phase 2: Automation and Deployment
|
|
35
|
+
|
|
36
|
+
**Goal**: Add git hooks, CI pipeline, and Vercel serverless structure with verification.
|
|
37
|
+
|
|
38
|
+
**Dependencies**: Phase 1 (requires working lint/test commands)
|
|
39
|
+
|
|
40
|
+
**Requirements**: TOOL-03, TOOL-04, VERCEL-01, VERCEL-02, VERCEL-03
|
|
41
|
+
|
|
42
|
+
**Success Criteria** (what must be TRUE when this phase completes):
|
|
43
|
+
1. Git commit triggers Husky pre-commit hook that runs lint-staged
|
|
44
|
+
2. Pushing to GitHub triggers Actions workflow that runs lint and test
|
|
45
|
+
3. `/api/health.ts` endpoint exists and returns a status response
|
|
46
|
+
4. `vercel build` succeeds locally without errors
|
|
47
|
+
5. Project structure follows Vercel Functions convention (`/api` directory)
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Progress
|
|
52
|
+
|
|
53
|
+
| Phase | Name | Status | Requirements |
|
|
54
|
+
|-------|------|--------|--------------|
|
|
55
|
+
| 1 | Foundation | Complete | INIT-01, INIT-02, INIT-03, TOOL-01, TOOL-02 |
|
|
56
|
+
| 2 | Automation and Deployment | Pending | TOOL-03, TOOL-04, VERCEL-01, VERCEL-02, VERCEL-03 |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
*Generated: 2026-01-29*
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# State
|
|
2
|
+
|
|
3
|
+
## Current Position
|
|
4
|
+
|
|
5
|
+
Phase: 1 of 2 (Foundation)
|
|
6
|
+
Plan: 2 of 2 in phase
|
|
7
|
+
Status: Phase complete
|
|
8
|
+
Last activity: 2026-01-29 - Completed 01-02-PLAN.md
|
|
9
|
+
|
|
10
|
+
## Progress
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
v0.1.0 Core Setup
|
|
14
|
+
[#####-----] Phase 1: Foundation (2/2 plans complete)
|
|
15
|
+
[----------] Phase 2: Automation and Deployment (0/? plans)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Accumulated Context
|
|
19
|
+
|
|
20
|
+
### Decisions Made
|
|
21
|
+
|
|
22
|
+
| ID | Decision | Rationale | Phase |
|
|
23
|
+
|----|----------|-----------|-------|
|
|
24
|
+
| esm-module-type | type: module in package.json | NodeNext module resolution requires ESM; Vercel serverless expects ESM | 01-01 |
|
|
25
|
+
| exact-versions | --save-exact for all dependencies | Reproducible builds; avoids surprise breakage from minor updates | 01-01 |
|
|
26
|
+
| license | Apache-2.0 | Matches PROJECT.md open source constraint | 01-01 |
|
|
27
|
+
| biome-2-organize-imports | Use assist.actions.source.organizeImports | Biome 2.x moved organize imports to assist section; old schema key invalid | 01-02 |
|
|
28
|
+
| biome-ignore-claude | Exclude .claude directory with includes pattern | Claude Code hooks directory contains external JS files that fail lint | 01-02 |
|
|
29
|
+
| vitest-pass-no-tests | Enable passWithNoTests option | Clean CI builds when no test files exist yet | 01-02 |
|
|
30
|
+
|
|
31
|
+
### Blockers
|
|
32
|
+
(None)
|
|
33
|
+
|
|
34
|
+
### Notes
|
|
35
|
+
- First milestone - establishing project foundation
|
|
36
|
+
- Kata Orchestrator is the first customer
|
|
37
|
+
- Stack: pnpm 10.x, Node.js 24.x, TypeScript 5.9.x, Biome 2.3.x, Vitest 4.x
|
|
38
|
+
- Engine warning on Node 23.6 is expected (project targets Node 24+)
|
|
39
|
+
- Phase 1 Foundation complete: all developer workflow commands functional
|
|
40
|
+
|
|
41
|
+
## Session Continuity
|
|
42
|
+
|
|
43
|
+
Last session: 2026-01-29 11:15 UTC
|
|
44
|
+
Stopped at: Completed 01-02-PLAN.md (Phase 1 complete)
|
|
45
|
+
Resume file: .planning/phases/02-automation/02-01-PLAN.md
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mode": "yolo",
|
|
3
|
+
"depth": "standard",
|
|
4
|
+
"parallelization": true,
|
|
5
|
+
"commit_docs": true,
|
|
6
|
+
"pr_workflow": true,
|
|
7
|
+
"model_profile": "quality",
|
|
8
|
+
"display": {
|
|
9
|
+
"statusline": true
|
|
10
|
+
},
|
|
11
|
+
"workflow": {
|
|
12
|
+
"research": true,
|
|
13
|
+
"plan_check": true,
|
|
14
|
+
"verifier": true
|
|
15
|
+
},
|
|
16
|
+
"github": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"issueMode": "auto"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
phase: 01-foundation
|
|
3
|
+
plan: 01
|
|
4
|
+
type: execute
|
|
5
|
+
wave: 1
|
|
6
|
+
depends_on: []
|
|
7
|
+
files_modified:
|
|
8
|
+
- package.json
|
|
9
|
+
- pnpm-lock.yaml
|
|
10
|
+
- .gitignore
|
|
11
|
+
autonomous: true
|
|
12
|
+
|
|
13
|
+
must_haves:
|
|
14
|
+
truths:
|
|
15
|
+
- "pnpm install completes without errors"
|
|
16
|
+
- "package.json exists with type: module and all required scripts"
|
|
17
|
+
- "pnpm-lock.yaml exists (lockfile generated)"
|
|
18
|
+
artifacts:
|
|
19
|
+
- path: "package.json"
|
|
20
|
+
provides: "Project manifest with scripts and dependencies"
|
|
21
|
+
contains: "type.*module"
|
|
22
|
+
- path: "pnpm-lock.yaml"
|
|
23
|
+
provides: "Dependency lockfile"
|
|
24
|
+
min_lines: 10
|
|
25
|
+
- path: ".gitignore"
|
|
26
|
+
provides: "Git ignore patterns for Node.js project"
|
|
27
|
+
contains: "node_modules"
|
|
28
|
+
key_links:
|
|
29
|
+
- from: "package.json"
|
|
30
|
+
to: "node_modules"
|
|
31
|
+
via: "pnpm install"
|
|
32
|
+
pattern: "devDependencies"
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
<objective>
|
|
36
|
+
Initialize the pnpm project with package.json, install dev dependencies, and configure .gitignore.
|
|
37
|
+
|
|
38
|
+
Purpose: Establish the foundation for all other tooling (TypeScript, Biome, Vitest require deps installed first).
|
|
39
|
+
Output: Working pnpm project with all dev dependencies installed.
|
|
40
|
+
</objective>
|
|
41
|
+
|
|
42
|
+
<context>
|
|
43
|
+
@.planning/PROJECT.md
|
|
44
|
+
@.planning/ROADMAP.md
|
|
45
|
+
@.planning/phases/01-foundation/01-RESEARCH.md
|
|
46
|
+
</context>
|
|
47
|
+
|
|
48
|
+
<tasks>
|
|
49
|
+
|
|
50
|
+
<task type="auto">
|
|
51
|
+
<name>Task 1: Initialize pnpm and install dependencies</name>
|
|
52
|
+
<files>package.json, pnpm-lock.yaml</files>
|
|
53
|
+
<action>
|
|
54
|
+
1. Initialize pnpm project: `pnpm init`
|
|
55
|
+
2. Edit package.json to set:
|
|
56
|
+
- name: "kata-context"
|
|
57
|
+
- version: "0.1.0"
|
|
58
|
+
- type: "module" (CRITICAL for ESM/NodeNext)
|
|
59
|
+
- engines: { "node": ">=24.0.0" }
|
|
60
|
+
- scripts:
|
|
61
|
+
- "dev": "tsc --watch"
|
|
62
|
+
- "build": "tsc"
|
|
63
|
+
- "test": "vitest run"
|
|
64
|
+
- "test:watch": "vitest"
|
|
65
|
+
- "lint": "biome lint ."
|
|
66
|
+
- "format": "biome format --write ."
|
|
67
|
+
- "check": "biome check --write ."
|
|
68
|
+
3. Install dev dependencies with exact versions:
|
|
69
|
+
`pnpm add -D --save-exact typescript@5.9.3 @types/node@24.0.0 vitest@4.0.17 @biomejs/biome@2.3.11`
|
|
70
|
+
|
|
71
|
+
IMPORTANT: Use --save-exact to pin versions for reproducible builds.
|
|
72
|
+
IMPORTANT: Must include "type": "module" - NodeNext requires ESM.
|
|
73
|
+
</action>
|
|
74
|
+
<verify>
|
|
75
|
+
- `cat package.json | grep '"type": "module"'` returns match
|
|
76
|
+
- `cat package.json | grep '"lint"'` returns match
|
|
77
|
+
- `ls pnpm-lock.yaml` exists
|
|
78
|
+
- `pnpm install` completes without errors
|
|
79
|
+
</verify>
|
|
80
|
+
<done>
|
|
81
|
+
- package.json has type: "module", all 7 scripts, and 4 devDependencies
|
|
82
|
+
- pnpm-lock.yaml generated
|
|
83
|
+
- node_modules populated
|
|
84
|
+
</done>
|
|
85
|
+
</task>
|
|
86
|
+
|
|
87
|
+
<task type="auto">
|
|
88
|
+
<name>Task 2: Update .gitignore for Node.js project</name>
|
|
89
|
+
<files>.gitignore</files>
|
|
90
|
+
<action>
|
|
91
|
+
Update .gitignore to include standard Node.js patterns:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
# Dependencies
|
|
95
|
+
node_modules/
|
|
96
|
+
|
|
97
|
+
# Build output
|
|
98
|
+
dist/
|
|
99
|
+
|
|
100
|
+
# IDE
|
|
101
|
+
.idea/
|
|
102
|
+
*.swp
|
|
103
|
+
*.swo
|
|
104
|
+
|
|
105
|
+
# OS
|
|
106
|
+
.DS_Store
|
|
107
|
+
Thumbs.db
|
|
108
|
+
|
|
109
|
+
# Test coverage
|
|
110
|
+
coverage/
|
|
111
|
+
|
|
112
|
+
# Environment
|
|
113
|
+
.env
|
|
114
|
+
.env.local
|
|
115
|
+
.env.*.local
|
|
116
|
+
|
|
117
|
+
# Vercel
|
|
118
|
+
.vercel
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Preserve any existing entries (the file currently has ".secrets" on one line).
|
|
122
|
+
</action>
|
|
123
|
+
<verify>`grep "node_modules" .gitignore` returns match</verify>
|
|
124
|
+
<done>.gitignore includes node_modules, dist, coverage, and .env patterns</done>
|
|
125
|
+
</task>
|
|
126
|
+
|
|
127
|
+
</tasks>
|
|
128
|
+
|
|
129
|
+
<verification>
|
|
130
|
+
Run these commands to verify phase completion:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Check package.json structure
|
|
134
|
+
cat package.json | grep -E '"type"|"scripts"|"devDependencies"'
|
|
135
|
+
|
|
136
|
+
# Verify lockfile exists
|
|
137
|
+
ls -la pnpm-lock.yaml
|
|
138
|
+
|
|
139
|
+
# Verify deps are installed
|
|
140
|
+
ls node_modules/.bin/tsc node_modules/.bin/vitest node_modules/.bin/biome
|
|
141
|
+
|
|
142
|
+
# Verify gitignore
|
|
143
|
+
grep "node_modules" .gitignore
|
|
144
|
+
```
|
|
145
|
+
</verification>
|
|
146
|
+
|
|
147
|
+
<success_criteria>
|
|
148
|
+
1. `pnpm install` runs without errors
|
|
149
|
+
2. package.json has type: "module"
|
|
150
|
+
3. package.json has all 7 required scripts (dev, build, test, test:watch, lint, format, check)
|
|
151
|
+
4. All 4 dev dependencies installed (typescript, @types/node, vitest, @biomejs/biome)
|
|
152
|
+
5. pnpm-lock.yaml exists
|
|
153
|
+
6. .gitignore includes node_modules and dist
|
|
154
|
+
</success_criteria>
|
|
155
|
+
|
|
156
|
+
<output>
|
|
157
|
+
After completion, create `.planning/phases/01-foundation/01-01-SUMMARY.md`
|
|
158
|
+
</output>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
phase: 01-foundation
|
|
3
|
+
plan: 01
|
|
4
|
+
subsystem: build-tooling
|
|
5
|
+
tags: [pnpm, package.json, gitignore, dependencies]
|
|
6
|
+
|
|
7
|
+
dependency-graph:
|
|
8
|
+
requires: []
|
|
9
|
+
provides:
|
|
10
|
+
- package.json with type: module and scripts
|
|
11
|
+
- pnpm lockfile
|
|
12
|
+
- node_modules with dev dependencies
|
|
13
|
+
- gitignore patterns for Node.js
|
|
14
|
+
affects:
|
|
15
|
+
- 01-02-PLAN.md (TypeScript, Biome, Vitest configuration)
|
|
16
|
+
- 02-01-PLAN.md (git hooks, CI)
|
|
17
|
+
|
|
18
|
+
tech-stack:
|
|
19
|
+
added:
|
|
20
|
+
- typescript@5.9.3
|
|
21
|
+
- "@types/node@24.0.0"
|
|
22
|
+
- vitest@4.0.17
|
|
23
|
+
- "@biomejs/biome@2.3.11"
|
|
24
|
+
patterns:
|
|
25
|
+
- ESM with type: module
|
|
26
|
+
- Exact version pinning with --save-exact
|
|
27
|
+
|
|
28
|
+
key-files:
|
|
29
|
+
created:
|
|
30
|
+
- package.json
|
|
31
|
+
- pnpm-lock.yaml
|
|
32
|
+
modified:
|
|
33
|
+
- .gitignore
|
|
34
|
+
|
|
35
|
+
decisions:
|
|
36
|
+
- id: esm-module-type
|
|
37
|
+
choice: "type: module in package.json"
|
|
38
|
+
rationale: "NodeNext module resolution requires ESM; Vercel serverless expects ESM"
|
|
39
|
+
- id: exact-versions
|
|
40
|
+
choice: "--save-exact for all dependencies"
|
|
41
|
+
rationale: "Reproducible builds; avoids surprise breakage from minor updates"
|
|
42
|
+
- id: license
|
|
43
|
+
choice: "Apache-2.0"
|
|
44
|
+
rationale: "Matches PROJECT.md open source constraint"
|
|
45
|
+
|
|
46
|
+
metrics:
|
|
47
|
+
duration: ~2 minutes
|
|
48
|
+
completed: 2026-01-29
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
# Phase 01 Plan 01: Initialize pnpm Project Summary
|
|
52
|
+
|
|
53
|
+
**One-liner:** pnpm project with ESM, 4 pinned dev deps, 7 scripts, and Node.js gitignore patterns.
|
|
54
|
+
|
|
55
|
+
## What Was Done
|
|
56
|
+
|
|
57
|
+
### Task 1: Initialize pnpm and install dependencies
|
|
58
|
+
- Ran `pnpm init` to create base package.json
|
|
59
|
+
- Configured package.json with:
|
|
60
|
+
- name: kata-context
|
|
61
|
+
- version: 0.1.0
|
|
62
|
+
- type: module (critical for NodeNext ESM)
|
|
63
|
+
- engines: node >= 24.0.0
|
|
64
|
+
- 7 scripts: dev, build, test, test:watch, lint, format, check
|
|
65
|
+
- Apache-2.0 license
|
|
66
|
+
- Installed exact versions of dev dependencies:
|
|
67
|
+
- typescript@5.9.3
|
|
68
|
+
- @types/node@24.0.0
|
|
69
|
+
- vitest@4.0.17
|
|
70
|
+
- @biomejs/biome@2.3.11
|
|
71
|
+
- **Commit:** `ef0e502`
|
|
72
|
+
|
|
73
|
+
### Task 2: Update .gitignore for Node.js project
|
|
74
|
+
- Preserved existing `.secrets/` entry
|
|
75
|
+
- Added standard Node.js patterns:
|
|
76
|
+
- node_modules/, dist/, coverage/
|
|
77
|
+
- IDE patterns (.idea/, *.swp, *.swo)
|
|
78
|
+
- OS patterns (.DS_Store, Thumbs.db)
|
|
79
|
+
- Environment patterns (.env, .env.local, .env.*.local)
|
|
80
|
+
- Vercel patterns (.vercel)
|
|
81
|
+
- **Commit:** `1a22794`
|
|
82
|
+
|
|
83
|
+
## Deviations from Plan
|
|
84
|
+
|
|
85
|
+
None - plan executed exactly as written.
|
|
86
|
+
|
|
87
|
+
## Verification Results
|
|
88
|
+
|
|
89
|
+
All verification commands passed:
|
|
90
|
+
- `cat package.json | grep '"type": "module"'` - matched
|
|
91
|
+
- `cat package.json | grep '"lint"'` - matched
|
|
92
|
+
- `ls pnpm-lock.yaml` - exists
|
|
93
|
+
- `pnpm install` - completed successfully (engine warning expected on Node 23.6)
|
|
94
|
+
- `ls node_modules/.bin/{tsc,vitest,biome}` - all present
|
|
95
|
+
- `grep "node_modules" .gitignore` - matched
|
|
96
|
+
|
|
97
|
+
## Success Criteria Status
|
|
98
|
+
|
|
99
|
+
| Criterion | Status |
|
|
100
|
+
|-----------|--------|
|
|
101
|
+
| pnpm install runs without errors | PASS |
|
|
102
|
+
| package.json has type: module | PASS |
|
|
103
|
+
| package.json has all 7 required scripts | PASS |
|
|
104
|
+
| All 4 dev dependencies installed | PASS |
|
|
105
|
+
| pnpm-lock.yaml exists | PASS |
|
|
106
|
+
| .gitignore includes node_modules and dist | PASS |
|
|
107
|
+
|
|
108
|
+
## Next Phase Readiness
|
|
109
|
+
|
|
110
|
+
Phase 01 Plan 02 can proceed. This plan provides:
|
|
111
|
+
- package.json with scripts ready for TypeScript, Biome, Vitest
|
|
112
|
+
- Dependencies installed and available in node_modules/.bin/
|
|
113
|
+
- .gitignore ready for dist/ output
|
|
114
|
+
|
|
115
|
+
No blockers or concerns for next plan.
|
|
116
|
+
|
|
117
|
+
## Artifacts
|
|
118
|
+
|
|
119
|
+
| Path | Purpose | Lines |
|
|
120
|
+
|------|---------|-------|
|
|
121
|
+
| package.json | Project manifest with scripts and dependencies | 28 |
|
|
122
|
+
| pnpm-lock.yaml | Dependency lockfile | ~1000 |
|
|
123
|
+
| .gitignore | Git ignore patterns for Node.js project | 28 |
|