Repository navigation
Configurable Workspace Paths (Cycle 0025) #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "mcpServers": { | ||
| "method": { | ||
| "command": "node", | ||
| "args": ["dist/cli.js", "mcp"] | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --- | ||
| title: "Configurable Workspace Paths" | ||
| legend: PROCESS | ||
| --- | ||
|
|
||
| # Configurable Workspace Paths | ||
|
|
||
| Source: dogfood discovery — METHOD's directory layout is fully hardcoded. | ||
| Legend: PROCESS | ||
|
|
||
| ## Sponsors | ||
|
|
||
| - Human: Process Steward | ||
| - Agent: Config Architect | ||
|
|
||
| ## Hill | ||
|
|
||
| Make METHOD's workspace directory layout configurable via `.method.json` | ||
| so projects can place backlog, design, retro, and other directories | ||
| wherever they want. | ||
|
|
||
| ## Playback Questions | ||
|
|
||
| ### Human | ||
|
|
||
| - [ ] A project with no `.method.json` gets the current default layout | ||
| with no behavioral change. | ||
| - [ ] A project with custom paths in `.method.json` has `method init` | ||
| scaffold to those paths and all commands operate against them. | ||
| - [ ] The `method status` output reflects the configured paths. | ||
|
|
||
| ### Agent | ||
|
|
||
| - [ ] `src/config.ts` defines a `paths` schema with defaults matching | ||
| the current layout. | ||
| - [ ] `Workspace` resolves all paths from config, not from global | ||
| constants. | ||
| - [ ] `detectWorkspaceDrift` accepts the tests directory from config. | ||
| - [ ] Tests prove both default and custom path configurations work. | ||
|
|
||
| ## Accessibility and Assistive Reading | ||
|
|
||
| Not in scope. | ||
|
|
||
| ## Localization and Directionality | ||
|
|
||
| Not in scope. | ||
|
|
||
| ## Agent Inspectability and Explainability | ||
|
|
||
| Path configuration is explicit in `.method.json` and visible via | ||
| `method status`. | ||
|
|
||
| ## Non-goals | ||
|
|
||
| - [ ] Runtime path migration (moving existing files to new paths). | ||
| - [ ] Per-lane path configuration (all lanes live under one backlog dir). | ||
| - [ ] Making `CHANGELOG.md` or `BEARING.md` locations configurable | ||
| (these are repo conventions, not METHOD internals). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| title: "Configurable Workspace Paths" | ||
| outcome: hill-met | ||
| drift_check: yes | ||
| --- | ||
|
|
||
| # Configurable Workspace Paths Retro | ||
|
|
||
| Design: `docs/design/0025-configurable-workspace-paths/configurable-workspace-paths.md` | ||
| Outcome: hill-met | ||
| Drift check: yes | ||
|
|
||
| ## Summary | ||
|
|
||
| Made METHOD's workspace directory layout fully configurable via the | ||
| `paths` section in `.method.json`. Projects can now place backlog, | ||
| design, retro, tests, graveyard, and the method directory wherever | ||
| they want. Defaults match the prior hardcoded layout — zero | ||
| behavioral change for existing workspaces. | ||
|
|
||
| ## Playback Witness | ||
|
|
||
| - [Verification Witness](./witness/verification.md) | ||
|
|
||
| ## Drift | ||
|
|
||
| - None recorded. | ||
|
|
||
| ## New Debt | ||
|
|
||
| - None recorded. | ||
|
|
||
| ## Cool Ideas | ||
|
|
||
| - None recorded. | ||
|
|
||
| ## Backlog Maintenance | ||
|
|
||
| - [x] Inbox processed | ||
| - [x] Priorities reviewed | ||
| - [x] Dead work buried or merged |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| title: "Verification Witness for Cycle 25" | ||
| --- | ||
|
|
||
| # Verification Witness for Cycle 25 | ||
|
|
||
| This witness proves that `Configurable Workspace Paths` now carries the required | ||
| behavior and adheres to the repo invariants. | ||
|
|
||
| ## Test Results | ||
|
|
||
| ``` | ||
| > method@0.2.0 test | ||
| > vitest run --config vitest.config.ts | ||
|
|
||
|
|
||
| RUN v4.1.2 ./method | ||
|
|
||
|
|
||
| Test Files 11 passed (11) | ||
| Tests 119 passed (119) | ||
| Start at 21:36:43 | ||
| Duration 665ms (transform 580ms, setup 0ms, import 1.43s, tests 822ms, environment 1ms) | ||
| ``` | ||
|
|
||
| ## Drift Results | ||
|
|
||
| ``` | ||
| Playback-question drift found. | ||
| Scanned 1 active cycle, 7 playback questions, 132 test descriptions. | ||
| Search basis: exact normalized match in tests/**/*.test.* and tests/**/*.spec.* descriptions. | ||
|
|
||
| docs/design/0025-configurable-workspace-paths/configurable-workspace-paths.md | ||
| - Human: A project with no `.method.json` gets the current default layout with no behavioral change. | ||
| No exact normalized test description match found. | ||
| - Human: A project with custom paths in `.method.json` has `method init` scaffold to those paths and all commands operate against them. | ||
| Near miss: "A project with custom paths in .method.json has method init scaffold to those paths and all commands operate against them." | ||
| - Human: The `method status` output reflects the configured paths. | ||
| No exact normalized test description match found. | ||
| - Agent: `src/config.ts` defines a `paths` schema with defaults matching the current layout. | ||
| No exact normalized test description match found. | ||
| - Agent: `Workspace` resolves all paths from config, not from global constants. | ||
| No exact normalized test description match found. | ||
| - Agent: `detectWorkspaceDrift` accepts the tests directory from config. | ||
| No exact normalized test description match found. | ||
| - Agent: Tests prove both default and custom path configurations work. | ||
| No exact normalized test description match found. | ||
| ``` | ||
|
|
||
| ## Manual Verification | ||
|
|
||
| - [x] Automated capture completed successfully. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,10 +2,31 @@ import { existsSync, readFileSync } from 'node:fs'; | |||||||||||||||||||
| import { join } from 'node:path'; | ||||||||||||||||||||
| import { z } from 'zod'; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export const PathsSchema = z.object({ | ||||||||||||||||||||
| backlog: z.string().default('docs/method/backlog'), | ||||||||||||||||||||
| design: z.string().default('docs/design'), | ||||||||||||||||||||
| retro: z.string().default('docs/method/retro'), | ||||||||||||||||||||
| tests: z.string().default('tests'), | ||||||||||||||||||||
| graveyard: z.string().default('docs/method/graveyard'), | ||||||||||||||||||||
| method_dir: z.string().default('docs/method'), | ||||||||||||||||||||
| }); | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export type PathsConfig = z.infer<typeof PathsSchema>; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export const DEFAULT_PATHS: PathsConfig = PathsSchema.parse({}); | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export const ConfigSchema = z.object({ | ||||||||||||||||||||
| forge: z.enum(['github']).default('github'), | ||||||||||||||||||||
| github_token: z.string().optional(), | ||||||||||||||||||||
| github_repo: z.string().optional(), // owner/repo | ||||||||||||||||||||
| paths: PathsSchema.default({ | ||||||||||||||||||||
| backlog: 'docs/method/backlog', | ||||||||||||||||||||
| design: 'docs/design', | ||||||||||||||||||||
| retro: 'docs/method/retro', | ||||||||||||||||||||
| tests: 'tests', | ||||||||||||||||||||
| graveyard: 'docs/method/graveyard', | ||||||||||||||||||||
| method_dir: 'docs/method', | ||||||||||||||||||||
| }), | ||||||||||||||||||||
|
Comment on lines
+22
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major DRY violation — defaults are duplicated and will drift. You've defined the same default values twice:
When the This duplication is a maintenance hazard. Someone will change one set and forget the other. Murphy's law. ♻️ Eliminate duplicate defaults export const ConfigSchema = z.object({
forge: z.enum(['github']).default('github'),
github_token: z.string().optional(),
github_repo: z.string().optional(), // owner/repo
- paths: PathsSchema.default({
- backlog: 'docs/method/backlog',
- design: 'docs/design',
- retro: 'docs/method/retro',
- tests: 'tests',
- graveyard: 'docs/method/graveyard',
- method_dir: 'docs/method',
- }),
+ paths: PathsSchema.default({}),
});📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| }); | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export type Config = z.infer<typeof ConfigSchema>; | ||||||||||||||||||||
|
|
||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new MCP config points to
dist/cli.js, but this repository does not include a builtdist/directory by default, so MCP clients that load.mcp.jsonin a fresh clone fail immediately withCannot find module '/workspace/method/dist/cli.js'. That makes the shipped MCP integration unusable unless users discover and run a separate build step first; the config should target a runnable source entrypoint or explicitly enforce/build before launch.Useful? React with 👍 / 👎.