devworkspace 0.0.0-stage → 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.
Files changed (187) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +21 -0
  3. package/README.md +127 -3
  4. package/dist/agents/claude/adapter.d.ts +10 -0
  5. package/dist/agents/claude/adapter.js +97 -0
  6. package/dist/agents/claude/adapter.js.map +1 -0
  7. package/dist/agents/claude/content.d.ts +7 -0
  8. package/dist/agents/claude/content.js +136 -0
  9. package/dist/agents/claude/content.js.map +1 -0
  10. package/dist/agents/types.d.ts +26 -0
  11. package/dist/agents/types.js +2 -0
  12. package/dist/agents/types.js.map +1 -0
  13. package/dist/cli/args.d.ts +194 -0
  14. package/dist/cli/args.js +93 -0
  15. package/dist/cli/args.js.map +1 -0
  16. package/dist/cli/help.d.ts +10 -0
  17. package/dist/cli/help.js +169 -0
  18. package/dist/cli/help.js.map +1 -0
  19. package/dist/cli/main.d.ts +2 -0
  20. package/dist/cli/main.js +19 -0
  21. package/dist/cli/main.js.map +1 -0
  22. package/dist/cli/render.d.ts +39 -0
  23. package/dist/cli/render.js +211 -0
  24. package/dist/cli/render.js.map +1 -0
  25. package/dist/cli/run.d.ts +10 -0
  26. package/dist/cli/run.js +329 -0
  27. package/dist/cli/run.js.map +1 -0
  28. package/dist/config/schemas.d.ts +76 -0
  29. package/dist/config/schemas.js +83 -0
  30. package/dist/config/schemas.js.map +1 -0
  31. package/dist/config/validate.d.ts +22 -0
  32. package/dist/config/validate.js +76 -0
  33. package/dist/config/validate.js.map +1 -0
  34. package/dist/core/migrations.d.ts +15 -0
  35. package/dist/core/migrations.js +34 -0
  36. package/dist/core/migrations.js.map +1 -0
  37. package/dist/core/version.d.ts +2 -0
  38. package/dist/core/version.js +12 -0
  39. package/dist/core/version.js.map +1 -0
  40. package/dist/core/versioned.d.ts +13 -0
  41. package/dist/core/versioned.js +16 -0
  42. package/dist/core/versioned.js.map +1 -0
  43. package/dist/core/workspace.d.ts +34 -0
  44. package/dist/core/workspace.js +92 -0
  45. package/dist/core/workspace.js.map +1 -0
  46. package/dist/decisions/decision.d.ts +31 -0
  47. package/dist/decisions/decision.js +123 -0
  48. package/dist/decisions/decision.js.map +1 -0
  49. package/dist/discovery/commands.d.ts +12 -0
  50. package/dist/discovery/commands.js +92 -0
  51. package/dist/discovery/commands.js.map +1 -0
  52. package/dist/discovery/detect.d.ts +72 -0
  53. package/dist/discovery/detect.js +421 -0
  54. package/dist/discovery/detect.js.map +1 -0
  55. package/dist/discovery/ignore.d.ts +6 -0
  56. package/dist/discovery/ignore.js +76 -0
  57. package/dist/discovery/ignore.js.map +1 -0
  58. package/dist/discovery/scan.d.ts +24 -0
  59. package/dist/discovery/scan.js +132 -0
  60. package/dist/discovery/scan.js.map +1 -0
  61. package/dist/errors/index.d.ts +25 -0
  62. package/dist/errors/index.js +39 -0
  63. package/dist/errors/index.js.map +1 -0
  64. package/dist/git/git.d.ts +27 -0
  65. package/dist/git/git.js +97 -0
  66. package/dist/git/git.js.map +1 -0
  67. package/dist/index.d.ts +26 -0
  68. package/dist/index.js +21 -0
  69. package/dist/index.js.map +1 -0
  70. package/dist/integrations/agent-skills.d.ts +10 -0
  71. package/dist/integrations/agent-skills.js +45 -0
  72. package/dist/integrations/agent-skills.js.map +1 -0
  73. package/dist/integrations/graphify.d.ts +7 -0
  74. package/dist/integrations/graphify.js +54 -0
  75. package/dist/integrations/graphify.js.map +1 -0
  76. package/dist/integrations/index.d.ts +6 -0
  77. package/dist/integrations/index.js +30 -0
  78. package/dist/integrations/index.js.map +1 -0
  79. package/dist/integrations/omniroute.d.ts +7 -0
  80. package/dist/integrations/omniroute.js +24 -0
  81. package/dist/integrations/omniroute.js.map +1 -0
  82. package/dist/integrations/ponytail.d.ts +10 -0
  83. package/dist/integrations/ponytail.js +58 -0
  84. package/dist/integrations/ponytail.js.map +1 -0
  85. package/dist/integrations/probe.d.ts +6 -0
  86. package/dist/integrations/probe.js +41 -0
  87. package/dist/integrations/probe.js.map +1 -0
  88. package/dist/integrations/types.d.ts +25 -0
  89. package/dist/integrations/types.js +2 -0
  90. package/dist/integrations/types.js.map +1 -0
  91. package/dist/knowledge/facts.d.ts +43 -0
  92. package/dist/knowledge/facts.js +195 -0
  93. package/dist/knowledge/facts.js.map +1 -0
  94. package/dist/portability/bundle.d.ts +22 -0
  95. package/dist/portability/bundle.js +102 -0
  96. package/dist/portability/bundle.js.map +1 -0
  97. package/dist/prompts/onboarding.d.ts +19 -0
  98. package/dist/prompts/onboarding.js +53 -0
  99. package/dist/prompts/onboarding.js.map +1 -0
  100. package/dist/prompts/refresh.d.ts +15 -0
  101. package/dist/prompts/refresh.js +33 -0
  102. package/dist/prompts/refresh.js.map +1 -0
  103. package/dist/prompts/requirements.d.ts +9 -0
  104. package/dist/prompts/requirements.js +34 -0
  105. package/dist/prompts/requirements.js.map +1 -0
  106. package/dist/security/files.d.ts +5 -0
  107. package/dist/security/files.js +44 -0
  108. package/dist/security/files.js.map +1 -0
  109. package/dist/security/redact.d.ts +13 -0
  110. package/dist/security/redact.js +43 -0
  111. package/dist/security/redact.js.map +1 -0
  112. package/dist/services/agent.d.ts +11 -0
  113. package/dist/services/agent.js +42 -0
  114. package/dist/services/agent.js.map +1 -0
  115. package/dist/services/analysis.d.ts +45 -0
  116. package/dist/services/analysis.js +151 -0
  117. package/dist/services/analysis.js.map +1 -0
  118. package/dist/services/common.d.ts +18 -0
  119. package/dist/services/common.js +18 -0
  120. package/dist/services/common.js.map +1 -0
  121. package/dist/services/doctor.d.ts +27 -0
  122. package/dist/services/doctor.js +223 -0
  123. package/dist/services/doctor.js.map +1 -0
  124. package/dist/services/init.d.ts +18 -0
  125. package/dist/services/init.js +135 -0
  126. package/dist/services/init.js.map +1 -0
  127. package/dist/services/knowledge.d.ts +40 -0
  128. package/dist/services/knowledge.js +72 -0
  129. package/dist/services/knowledge.js.map +1 -0
  130. package/dist/services/migrate.d.ts +16 -0
  131. package/dist/services/migrate.js +54 -0
  132. package/dist/services/migrate.js.map +1 -0
  133. package/dist/services/portability.d.ts +27 -0
  134. package/dist/services/portability.js +155 -0
  135. package/dist/services/portability.js.map +1 -0
  136. package/dist/services/records.d.ts +8 -0
  137. package/dist/services/records.js +26 -0
  138. package/dist/services/records.js.map +1 -0
  139. package/dist/services/refresh.d.ts +22 -0
  140. package/dist/services/refresh.js +64 -0
  141. package/dist/services/refresh.js.map +1 -0
  142. package/dist/services/status.d.ts +57 -0
  143. package/dist/services/status.js +111 -0
  144. package/dist/services/status.js.map +1 -0
  145. package/dist/services/tasks.d.ts +44 -0
  146. package/dist/services/tasks.js +136 -0
  147. package/dist/services/tasks.js.map +1 -0
  148. package/dist/sessions/session.d.ts +19 -0
  149. package/dist/sessions/session.js +53 -0
  150. package/dist/sessions/session.js.map +1 -0
  151. package/dist/tasks/routing.d.ts +27 -0
  152. package/dist/tasks/routing.js +206 -0
  153. package/dist/tasks/routing.js.map +1 -0
  154. package/dist/tasks/task.d.ts +90 -0
  155. package/dist/tasks/task.js +275 -0
  156. package/dist/tasks/task.js.map +1 -0
  157. package/dist/utils/cleanup.d.ts +3 -0
  158. package/dist/utils/cleanup.js +18 -0
  159. package/dist/utils/cleanup.js.map +1 -0
  160. package/dist/utils/fs.d.ts +17 -0
  161. package/dist/utils/fs.js +164 -0
  162. package/dist/utils/fs.js.map +1 -0
  163. package/dist/utils/lock.d.ts +6 -0
  164. package/dist/utils/lock.js +77 -0
  165. package/dist/utils/lock.js.map +1 -0
  166. package/dist/utils/logger.d.ts +11 -0
  167. package/dist/utils/logger.js +18 -0
  168. package/dist/utils/logger.js.map +1 -0
  169. package/dist/utils/paths.d.ts +18 -0
  170. package/dist/utils/paths.js +95 -0
  171. package/dist/utils/paths.js.map +1 -0
  172. package/dist/utils/proc.d.ts +22 -0
  173. package/dist/utils/proc.js +74 -0
  174. package/dist/utils/proc.js.map +1 -0
  175. package/docs/architecture.md +53 -0
  176. package/docs/benchmarking.md +33 -0
  177. package/docs/claude.md +46 -0
  178. package/docs/contributing.md +64 -0
  179. package/docs/getting-started.md +68 -0
  180. package/docs/integrations.md +51 -0
  181. package/docs/knowledge.md +66 -0
  182. package/docs/portability.md +40 -0
  183. package/docs/routing.md +51 -0
  184. package/docs/security.md +44 -0
  185. package/docs/testing.md +58 -0
  186. package/docs/troubleshooting.md +26 -0
  187. package/package.json +68 -4
@@ -0,0 +1,58 @@
1
+ # Testing contract and verification
2
+
3
+ ## The testing contract
4
+
5
+ `devworkspace analyze` infers which verification commands the *project* has and stores them in `.devworkspace/context/commands.json`:
6
+
7
+ | Check | Available | Command | Required |
8
+ | --- | --- | --- | --- |
9
+ | typecheck | yes | `npm run typecheck` | yes |
10
+ | unit | yes | `npm test` | yes |
11
+ | integration | yes | `npm run test:integration` | context |
12
+ | e2e | yes | `npm run test:e2e` | context |
13
+ | lint | yes | `npm run lint` | yes |
14
+ | build | yes | `npm run build` | yes |
15
+
16
+ `required` is `yes` (always applies to code changes), `context` (only when relevant to the change) or `no`. Entries you or the agent edit by hand get `origin: "user"` and are never overwritten by later analysis.
17
+
18
+ Sources: `package.json` scripts (matched by common names), plus conventions for Python (pytest/ruff/mypy/black/alembic), Go, Rust, Maven and Gradle. npm's default `"no test specified"` placeholder is ignored.
19
+
20
+ ### Commands are untrusted input
21
+
22
+ Everything marked `origin: "repository-script"` comes from files in the repository. DevWorkspace **never runs these commands itself**; the agent does, and the generated instructions tell it to read what a script does before running unfamiliar ones, especially where scripts might deploy, migrate or write over the network.
23
+
24
+ ## Task-specific verification
25
+
26
+ Questions need none; docs need only documentation checks; bugs, features and refactors derive their checks from the contract (see [routing](routing.md)). Baseline handling:
27
+
28
+ ```bash
29
+ devworkspace task tests <id> --phase baseline --passed 214 --failed 3 # before changing code
30
+ devworkspace task tests <id> --phase after --passed 218 --failed 3
31
+ devworkspace task verify <id> unit pass
32
+ ```
33
+
34
+ Pre-existing failures are recorded, not blamed on new work. Regressions block completion.
35
+
36
+ ## Failure reporting
37
+
38
+ ```text
39
+ STATUS: BLOCKED
40
+ Unit tests: FAIL Typecheck: PASS Lint: PASS Build: FAIL
41
+ Failure: <actual error>
42
+ Task is not considered complete.
43
+ ```
44
+
45
+ ## Testing DevWorkspace itself
46
+
47
+ ```bash
48
+ npm test # unit + integration + e2e (vitest)
49
+ npm run test:unit | test:integration | test:e2e
50
+ npm run coverage # thresholds enforced (stricter on security, paths, tasks, knowledge, portability)
51
+ npm run typecheck && npm run lint
52
+ npm run smoke # pack → install tarball into clean dirs → run the real CLI (local, --prefix, npx, PowerShell)
53
+ npm run release:check # the full pre-publish gate; never publishes
54
+ ```
55
+
56
+ Layers: **unit** (pure logic, security, paths incl. `path.win32`, schemas, routing scenarios, prompts), **integration** (command flows through the real CLI in-process with a hermetic home directory), **e2e** (the ten acceptance scenarios, Windows-style paths, large repo simulation, concurrency, hostile imports). Fixtures live in `fixtures/` (Express, React/Vite, Next.js, NestJS, FastAPI, monorepo, no tests, failing tests, existing AI files, prompt injection); scenarios that need Git state, secrets or unusual paths are built at test time.
57
+
58
+ The generated prompts are tested for *behaviour*, not snapshots: `prompts/requirements.ts` lists what every onboarding/refresh prompt must instruct (untrusted-data rule, no secrets, evidence, git safety, testing contract, completion gate, memory rules, …), and `validatePrompt` is used by the tests and by `doctor`.
@@ -0,0 +1,26 @@
1
+ # Troubleshooting
2
+
3
+ Start with `devworkspace doctor`. Every warning/failure includes a remediation line.
4
+
5
+ | Problem | What to do |
6
+ | --- | --- |
7
+ | **Unsupported Node version** | Needs Node ≥ 20.11. `node -v`; install from nodejs.org or use nvm/fnm. `doctor` shows the requirement. |
8
+ | **Git unavailable** | Install Git. DevWorkspace still works but cannot report branch/working-tree state or tracked-secret problems, and Claude cannot protect uncommitted changes. |
9
+ | **Not a Git repository** | Fine. `status` shows `Git: not a repository`. Consider `git init` so changes can be reviewed and reverted. |
10
+ | **"No DevWorkspace found"** | Run `devworkspace init` in the project root. Commands search upward from the current directory; use `--cwd <dir>` if you are elsewhere. |
11
+ | **Graphify unavailable / no graph** | `uv tool install graphifyy` (or `pipx`), `graphify install --project`, then run `/graphify .` in Claude Code. DevWorkspace keeps working without it. |
12
+ | **Agent Skills / Ponytail "Unverified"** | Claude Code owns plugin state, so this is best-effort. In Claude Code run `/plugin` to see installed plugins, or install: `/plugin marketplace add addyosmani/agent-skills` → `/plugin install agent-skills@addy-agent-skills`; `/plugin marketplace add DietrichGebert/ponytail` → `/plugin install ponytail@ponytail`. |
13
+ | **Claude config conflict** (`agent install` reports `CONFLICT`) | Unbalanced `devworkspace:start/end` markers in `CLAUDE.md`, or a user-authored skill at `.claude/skills/devworkspace/`. Fix/remove the stray marker or rename your skill, then re-run. Nothing was changed. |
14
+ | **Claude ignores my `AGENTS.md`** | Claude reads `AGENTS.md` only when no `CLAUDE.md` exists. `agent install` adds an `@AGENTS.md` import when it creates `CLAUDE.md`; if you created `CLAUDE.md` yourself, add `@AGENTS.md` to it. |
15
+ | **Stale context** | `devworkspace refresh`, then paste `.devworkspace/analysis/refresh-prompt.md` into Claude. Facts without cited `--file` sources can never be proven stale. |
16
+ | **Corrupted workspace** (`malformed JSON`, schema errors) | `git checkout -- .devworkspace/<file>`; or copy a backup from `.devworkspace/local/backups/`. A newer-schema file means upgrade DevWorkspace. Leftover `*.tmp` files come from an interrupted write and are safe to delete. |
17
+ | **"Another DevWorkspace process is modifying this workspace"** | Wait. If no DevWorkspace process is running, delete `.devworkspace/local/workspace.lock` (stale locks from dead processes are normally broken automatically). |
18
+ | **Tests were failing before my task** | Record a baseline: `devworkspace task tests <id> --phase baseline --passed N --failed M`. Only *increases* in failures block completion. |
19
+ | **Project moved / different drive** | Nothing to do; identity is an id, not a path. `doctor` warns if knowledge contains absolute paths. |
20
+ | **Package manager unavailable** | The testing contract is inferred from files, so it lists `pnpm`/`yarn` commands even if not installed. Edit `context/commands.json` (set `origin: "user"`) to use what you have. |
21
+ | **Windows: `EPERM` on write** | Editors, antivirus or indexers can briefly lock files; writes retry for ~2 s. If it persists, close the program holding the file. |
22
+ | **Windows: PowerShell blocks `devworkspace.ps1`** | `npm` creates `.cmd` and `.ps1` shims. Run via `devworkspace.cmd`, `npx devworkspace`, or relax the execution policy for your user (`Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`). |
23
+ | **`.devworkspace` not appearing in Git** | The root `.gitignore` ignores it. Remove that rule; `.devworkspace/.gitignore` already excludes the machine-local parts. |
24
+ | **Analysis seems incomplete** | `status`/`doctor` says "partial" when file or depth limits were hit. Raise `settings.maxFiles` in `project.json` or add `.devworkspaceignore` entries for generated folders. |
25
+
26
+ Add `--debug` to any command for stack traces and debug logs (secrets are still redacted).
package/package.json CHANGED
@@ -1,6 +1,70 @@
1
1
  {
2
2
  "name": "devworkspace",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Project-local AI engineering workspace: deterministic repository discovery, portable project knowledge, tasks, decisions and verification gates for AI coding agents.",
5
+ "type": "module",
6
+ "bin": {
7
+ "devworkspace": "dist/cli/main.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md",
21
+ "CHANGELOG.md",
22
+ "docs",
23
+ "!docs/implementation"
24
+ ],
25
+ "engines": {
26
+ "node": ">=20.11"
27
+ },
28
+ "scripts": {
29
+ "build": "node scripts/clean.mjs dist && tsc -p tsconfig.build.json",
30
+ "typecheck": "tsc -p tsconfig.json --noEmit",
31
+ "lint": "eslint .",
32
+ "test": "vitest run",
33
+ "test:unit": "vitest run tests/unit",
34
+ "test:integration": "vitest run tests/integration",
35
+ "test:e2e": "vitest run tests/e2e",
36
+ "coverage": "vitest run --coverage",
37
+ "audit:security": "npm audit --omit=dev --audit-level=high",
38
+ "smoke": "node scripts/smoke.mjs",
39
+ "release:check": "node scripts/release-check.mjs",
40
+ "prepack": "npm run build"
41
+ },
42
+ "keywords": [
43
+ "ai",
44
+ "claude",
45
+ "claude-code",
46
+ "agent",
47
+ "workspace",
48
+ "developer-tools",
49
+ "knowledge",
50
+ "cli"
51
+ ],
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/SHIKHIL8137/devworkspace.git"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/SHIKHIL8137/devworkspace/issues"
58
+ },
59
+ "homepage": "https://github.com/SHIKHIL8137/devworkspace#readme",
60
+ "license": "MIT",
61
+ "devDependencies": {
62
+ "@eslint/js": "^10.0.1",
63
+ "@types/node": "^26.6.4",
64
+ "@vitest/coverage-v8": "^5.0.3",
65
+ "eslint": "^10.12.0",
66
+ "typescript": "^6.0.3",
67
+ "typescript-eslint": "^8.71.1",
68
+ "vitest": "^5.0.3"
69
+ }
70
+ }