-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathprogress.txt
More file actions
233 lines (157 loc) · 14.2 KB
/
Copy pathprogress.txt
File metadata and controls
233 lines (157 loc) · 14.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
## Progress Log
### 2026-02-26 — skill-opencode-integration plan (Tapestry)
Completed all 11 tasks in `.weave/plans/skill-opencode-integration.md` — replaced Weave's custom filesystem skill scanning with OpenCode's `GET /skill` HTTP API.
**Philosophy**: Users manage skills in one place (OpenCode's standard skill locations: `~/.config/opencode/skills/` and `.opencode/skills/`). Weave's specialized agents consume them via explicit config assignment in `weave-opencode.jsonc`. No more `weave-opencode/skills/` directory.
**New files:**
- `src/features/skill-loader/opencode-client.ts` — `fetchSkillsFromOpenCode(serverUrl, directory)` calls `GET /skill`, maps response to `LoadedSkill[]`, graceful fallback on error
- `src/features/skill-loader/opencode-client.test.ts` — 10 tests covering mapping, scope derivation, error handling, URL encoding
**Modified files:**
- `src/features/skill-loader/loader.ts` — `loadSkills()` now async, uses `fetchSkillsFromOpenCode` instead of filesystem scanning; `LoadSkillsOptions` gains `serverUrl` field
- `src/features/skill-loader/loader.test.ts` — fully rewritten with mocked HTTP responses (7 tests)
- `src/features/skill-loader/index.ts` — updated barrel: removed deleted exports, added `fetchSkillsFromOpenCode`
- `src/features/skill-loader/types.ts` — `LoadedSkill.scope` made optional; `SkillMetadata` removed (no longer needed)
- `src/create-tools.ts` — passes `ctx.serverUrl` to `loadSkills()`
- `src/config/schema.ts` — removed dead `SkillsConfigSchema`, `SkillsConfig`, and `skills` field from `WeaveConfigSchema`
- `src/config/merge.ts` — removed dead `skills` field merge
- `src/config/loader.ts` — added optional `homeDir` override parameter for test isolation
- `src/config/loader.test.ts` — fixed pre-existing test isolation bug (user's real config was leaking into tests)
**Deleted files:**
- `src/features/skill-loader/discovery.ts` — filesystem scanning replaced by SDK
- `src/features/skill-loader/discovery.test.ts`
- `src/features/skill-loader/merger.ts` — priority merging now handled by OpenCode
- `src/features/skill-loader/builtin-skills.ts` — vestigial empty array
**Key design decisions:**
- Raw `fetch()` to `GET /skill` rather than v2 SDK (v1 client has no `skills()` method; raw fetch avoids SDK version mismatch)
- `scope` derived from `location` field: contains `.opencode` → project, else → user
- Agent-specific skill assignment unchanged: `agents.tapestry.skills: ["skill-name"]` in `weave-opencode.jsonc`
- Override skill resolution in `builtin-agents.ts` untouched — source-agnostic, works with any `resolveSkills` function
536 tests pass. Build and typecheck clean.
### 2026-02-26 — tapestry-revert-v052: Full revert to v0.5.2 + cherry-pick Tapestry Verification
Completed all 5 tasks in `.weave/plans/tapestry-revert-v052.md` — reverted all 14 files changed since v0.5.2 back to their tagged state, then re-applied only the Tapestry `<Verification>` section and step 3c reference.
**Files changed:**
- `src/agents/tapestry/default.ts` — step 3c now references `<Verification>` protocol; `<Verification>` section added between `</PlanExecution>` and `<Execution>`; all other content is byte-identical to v0.5.2 (including step 5 post-execution review wording)
- `src/agents/tapestry/index.test.ts` — 7 Verification-related tests added; 7 original v0.5.2 tests preserved; total 14 tests
**Reverted to v0.5.2 (no post-v0.5.2 content):**
- `src/agents/loom/default.ts` — restored mandatory Step 5 post-execution review in PlanWorkflow
- `src/agents/loom/index.test.ts` — restored 3 deleted tests, reverted renamed test
- `src/hooks/start-work-hook.ts` — reverted "Loom" references back to "Pattern"
- `src/hooks/start-work-hook.test.ts` — reverted test assertions
- `src/hooks/verification-reminder.ts` — reverted to Weft/Warp delegation with git diff and automated checks
- `src/hooks/verification-reminder.test.ts` — reverted test assertions
- `src/hooks/work-continuation.ts` — removed switchAgent/clearWorkState on completion
- `src/hooks/work-continuation.test.ts` — removed 7 new tests
- `src/plugin/plugin-interface.ts` — removed agent passing to promptAsync
- `src/plugin/plugin-interface.test.ts` — removed 7 new tests
- `src/workflow.test.ts` — reverted integration tests
- `progress.txt` — reverted to v0.5.2 state (this entry is the only post-v0.5.2 addition)
**Result:** 519 tests pass, 0 failures. Non-Tapestry files are byte-identical to v0.5.2.
### 2026-02-22 — plan-validation plan: Add plan validation before /start-work (Tapestry)
Completed all 11 tasks in `.weave/plans/plan-validation.md` — added `validatePlan()` function that structurally validates plan files before Tapestry begins execution.
**New files:**
- `src/features/work-state/validation-types.ts` — `ValidationSeverity`, `ValidationIssue`, `ValidationResult`, `ValidationCategory` types
- `src/features/work-state/validation.ts` — `validatePlan(planPath, projectDir)` implementing 6 validation categories: structure, checkboxes, file-references, numbering, effort-estimate, verification
- `src/features/work-state/validation.test.ts` — 26 unit tests covering all scenarios
**Modified files:**
- `src/features/work-state/index.ts` — exports `validatePlan` and all new types
- `src/hooks/start-work-hook.ts` — integrates `validatePlan()` into all 3 paths (explicit, discovery, resume); errors block state creation; warnings are appended to context injection; added `formatValidationResults()` export
- `src/hooks/start-work-hook.test.ts` — fully rewritten with valid plan helper and new validation tests (19 tests)
- `src/workflow.test.ts` — added `makeValidPlanContent()` helper; updated 9 tests to use valid plan content and corrected count assertions (plans now have TODOs + Verification checkbox)
**Key design decisions:**
- Errors (missing required sections, no checkboxes, duplicate numbers, empty verification) are **blocking** — no work state created
- Warnings (missing optional sections, missing sub-fields, file references, number gaps) are **non-blocking** — appended to context injection
- Resume path also validates — malformed resumed plans clear state and return error
- `extractSection()` uses line-by-line parsing (not regex) to avoid `$` lookahead bug with multiline flag
493 tests pass. `bun run typecheck` and `bun run build` clean.
**GitHub**: Implements issue #3
---
### 2026-02-22 — Fix #1: Wire context window monitor to real token data (Tapestry)
Fixed the context window monitor never firing because it was called with hardcoded `{ usedTokens: 0, maxTokens: 0 }`.
**Root cause**: `plugin-interface.ts` called `checkContextWindow({ usedTokens: 0, maxTokens: 0 })` from the `chat.message` hook, where token data is not available.
**Changes**:
- `src/hooks/session-token-state.ts` (NEW): In-memory `Map<sessionId, {maxTokens, usedTokens}>` with `setContextLimit`, `updateUsage`, `getState`, `clearSession`, `clear`
- `src/hooks/session-token-state.test.ts` (NEW): 9 unit tests covering all state operations
- `src/hooks/create-hooks.ts`: Reads `experimental.context_window_warning_threshold` and `experimental.context_window_critical_threshold` from config (defaults 0.8/0.95)
- `src/hooks/create-hooks.test.ts`: 3 new threshold tests
- `src/hooks/index.ts`: Exports session token state functions
- `src/plugin/plugin-interface.ts`: `chat.params` captures `model.limit.context` per session; `event` handler processes `message.updated` (assistant role, `tokens.input > 0`) to call `checkContextWindow` with real data; `session.deleted` clears session state; hardcoded zero call removed from `chat.message`
- `src/plugin/plugin-interface.test.ts`: 7 new context window monitoring tests
460 tests pass. Build and typecheck clean.
**GitHub**: Fixes issue #1
---
### 2026-02-22 — Fix #15: PlanWorkflow/ReviewWorkflow contradiction (Tapestry)
Fixed a contradiction in `src/agents/loom/default.ts` where the PlanWorkflow marked Weft review as "(optional)" while ReviewWorkflow listed mandatory criteria that clearly applied to multi-step plans touching 3+ files.
**Root cause**: The `REVIEW (optional)` label on line 92 gave Loom an easy out to skip plan review, even when all ReviewWorkflow trigger conditions were met.
**Changes**:
- `src/agents/loom/default.ts`: Removed "(optional)", added explicit TRIGGER (3+ files OR 5+ tasks → mandatory) and SKIP ONLY IF (user says "skip review") conditions
- `src/agents/loom/index.test.ts`: Added 3 regression tests asserting the review step is not optional and contains trigger/skip conditions
440 tests pass. Build clean.
**GitHub**: Fixes issue #15
---
### 2026-02-22 — Add repository dispatch to notify weave-website on publish
Added a step to `publish.yml` that sends a `repository_dispatch` event to `pgermishuys/weave-website` after npm publish. This triggers the website to update its hardcoded version badge in `index.html` and redeploy, so users with JS disabled see the correct version.
**Requires**: `WEBSITE_DISPATCH_TOKEN` secret (PAT with `repo` scope) in this repo's GitHub settings.
**Files changed**: `.github/workflows/publish.yml`
---
### 2026-02-22 — Fix delegation logging field mismatch
Fixed broken delegation observability logging from v0.4.0 commit.
**Root cause**: `tool.execute.before` and `tool.execute.after` hooks read `args.agent` to identify the delegated agent, but the OpenCode task tool uses `subagent_type` (not `agent`). This meant:
- `tool.execute.after` always logged `agent=unknown` in production
- `tool.execute.before` fell back to `args.description` (logged description text instead of agent name)
- Tests used fake `{ agent: "thread" }` data, masking the bug
**Changes**:
- `src/plugin/plugin-interface.ts`: Changed both hooks to read `subagent_type` first, then `description` as fallback
- `src/plugin/plugin-interface.test.ts`: Updated tests to use real SDK data shape (`subagent_type`), added fallback-to-description test
All 437 tests pass. Build clean.
---
### 2026-02-21 — todowrite-sidebar-integration plan (Tapestry)
Completed all 6 tasks in the `todowrite-sidebar-integration` plan:
1. **Tapestry prompt** (`src/agents/tapestry/default.ts`): Added `<SidebarTodos>` section with concrete instructions for when/how to write sidebar todos during plan execution (STARTING, COMPLETING, BLOCKED, COMPLETES states). Max 35 chars, max 5 todos, `in_progress` for current task only.
2. **Loom prompt** (`src/agents/loom/default.ts`): Added `<SidebarTodos>` section with delegation-aware todowrite instructions (PLANNING, DELEGATING, QUICK TASKS states). Agent-prefixed delegations, clear completion signaling.
3. **start-work-hook** (`src/hooks/start-work-hook.ts`): Enhanced `buildFreshContext()` and `buildResumeContext()` to inject `**SIDEBAR TODOS**` bootstrapping instructions. Resume context includes remaining task count.
4. **context-window-monitor** (`src/hooks/context-window-monitor.ts`): Warning and recovery messages now include `todowrite` instructions to surface context alerts in the sidebar with `in_progress` status for visual prominence.
5. **work-continuation** (`src/hooks/work-continuation.ts`): Continuation prompt now instructs the agent to restore sidebar state via `todowrite` (summary + next task + 2-3 upcoming) before resuming work.
6. **Tests updated**: Added "SIDEBAR TODOS" assertions to start-work-hook tests, "todowrite" assertions to context-window-monitor and work-continuation tests.
All 404 tests pass. Build succeeds.
**Next**: This plan is complete. No follow-on work identified.
---
### 2026-02-21 — warp-agent plan (Tapestry)
Completed all 15 tasks in the `.weave/plans/warp-agent.md` plan — added **Warp** as the 8th built-in agent (security & specification compliance auditor).
**New files:**
- `src/agents/warp/default.ts` — full system prompt (Role, Triage, SecurityReview, SpecificationCompliance, Verdict, SkepticalBias, Constraints)
- `src/agents/warp/index.ts` — factory function following Weft pattern
- `src/agents/warp/index.test.ts` — 15 unit tests
**Modified source files:**
- `src/agents/types.ts` — added `"warp"` to `WeaveAgentName` union
- `src/agents/builtin-agents.ts` — imported and registered `createWarpAgent`
- `src/agents/model-resolution.ts` — Sonnet-class fallback chain for warp
- `src/agents/dynamic-prompt-builder.ts` — added `buildWarpSection` function
- `src/agents/loom/default.ts` — Warp added to Delegation and ReviewWorkflow sections
- `src/hooks/verification-reminder.ts` — Warp reference for security-relevant changes
- `src/shared/agent-display-names.ts` — added `warp: "warp"` entry
**Updated tests:** builtin-agents.test.ts, dynamic-prompt-builder.test.ts, agent-display-names.test.ts, workflow.test.ts, integration.test.ts (all counts updated from 7→8 agents).
**Updated docs:** README.md, docs/architecture.md, docs/agent-interactions.md, docs/configuration.md.
Key design decisions:
- Warp is **read-only** (write, edit, task, call_weave_agent all denied)
- **Skeptical bias** — REJECT by default when security patterns detected
- **Sonnet-class model** (needs reasoning power for spec analysis)
- **Self-triaging** — fast-exits with [APPROVE] if no security-relevant changes detected
- Three-layer spec knowledge: built-in LLM → webfetch RFC verification → optional `.weave/specs.json`
All 427 tests pass. Build and typecheck clean (zero warnings).
**Next**: Warp is fully integrated. Future work could add `.weave/specs.json` support to the config schema if project-level spec registries are needed.
---
### 2026-02-21 — Release v0.3.1
Released **v0.3.1** to GitHub.
- Optimized agent model assignments for role-appropriate reasoning:
- **Weft** (reviewer): haiku-4.5 → sonnet-4.6 — better code review quality
- **Warp** (security auditor): sonnet-4.6 → opus-4.6 — deeper security reasoning
- **Spindle** (external researcher): sonnet-4.6 → haiku-4.5 — cost efficiency for fetch-and-format tasks
- All 427 tests passing, build clean
**Previous release**: v0.3.0 → **New release**: v0.3.1
---
### 2026-02-21 — Release v0.3.0
Released **v0.3.0** to GitHub: https://github.com/pgermishuys/weave/releases/tag/v0.3.0
- Bumped `package.json` version from `0.2.0` → `0.3.0`
- Created git tag `v0.3.0` and pushed to remote
- Created GitHub release with full changelog highlighting the Warp agent addition
- All 427 tests passing, build clean
**Previous release**: v0.2.0 → **New release**: v0.3.0