@jterrats/open-orchestra 1.0.11 → 1.0.13

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 (34) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/command-manifest.js +1 -1
  3. package/dist/command-manifest.js.map +1 -1
  4. package/dist/runtime-claude-native-bridge.d.ts +2 -0
  5. package/dist/runtime-claude-native-bridge.js +59 -0
  6. package/dist/runtime-claude-native-bridge.js.map +1 -0
  7. package/dist/runtime-execution.js +3 -0
  8. package/dist/runtime-execution.js.map +1 -1
  9. package/dist/runtime-parent-action-capacity.d.ts +10 -0
  10. package/dist/runtime-parent-action-capacity.js +110 -0
  11. package/dist/runtime-parent-action-capacity.js.map +1 -0
  12. package/dist/runtime-parent-action-dispatch.d.ts +1 -7
  13. package/dist/runtime-parent-action-dispatch.js +84 -90
  14. package/dist/runtime-parent-action-dispatch.js.map +1 -1
  15. package/dist/runtime-parent-action-eligibility.d.ts +10 -1
  16. package/dist/runtime-parent-action-eligibility.js +15 -2
  17. package/dist/runtime-parent-action-eligibility.js.map +1 -1
  18. package/dist/runtime-parent-action-fallback.d.ts +11 -0
  19. package/dist/runtime-parent-action-fallback.js +12 -0
  20. package/dist/runtime-parent-action-fallback.js.map +1 -0
  21. package/dist/task-graph-commands.js +18 -14
  22. package/dist/task-graph-commands.js.map +1 -1
  23. package/dist/types/runtime.d.ts +8 -0
  24. package/dist/workflow-run-commands.js +17 -9
  25. package/dist/workflow-run-commands.js.map +1 -1
  26. package/dist/workflow-task-service.js +27 -1
  27. package/dist/workflow-task-service.js.map +1 -1
  28. package/docs/audio-video-transcription-skill.md +441 -45
  29. package/docs/autonomous-workflow.md +38 -0
  30. package/docs/backlog/web-code-editor-lsp-spike.md +289 -0
  31. package/docs/context-vault.md +80 -0
  32. package/docs/runtime-adapters.md +11 -0
  33. package/docs/site-manifest.json +1 -0
  34. package/package.json +1 -1
@@ -0,0 +1,289 @@
1
+ # Spike: Orchestra-Aware Web Code Editor With LSP
2
+
3
+ Backlog Item ID: EPIC-ORCHESTRA-AWARE-CODE-EDITOR
4
+ GitHub Issue: GH-447
5
+ Lead role: Architect
6
+ Supporting roles: UX/UI, Developer, Security, QA
7
+ Status: proposed
8
+
9
+ ## Goal
10
+
11
+ Define the MVP architecture for an embedded web code editor that lets users
12
+ inspect workspace-local files, use standard language intelligence, and perform
13
+ governed edits without losing Orchestra task traceability, policy gates, QA
14
+ evidence, or workspace isolation.
15
+
16
+ This spike is architecture and planning only. It does not implement source
17
+ changes.
18
+
19
+ ## Product Position
20
+
21
+ The editor should not compete with VS Code as a full IDE. Its differentiator is
22
+ workflow-aware editing: active task, backlog item, acceptance criteria, role
23
+ contracts, context-pack suggestions, visible policy gates, task-scoped diffs,
24
+ file timeline, rollback guidance, and quality warnings such as god-file risk,
25
+ missing tests, stale generated docs, and release gate blockers.
26
+
27
+ ## Editor Choice
28
+
29
+ Use CodeMirror 6 for the MVP, with Monaco kept as a later option if native VS
30
+ Code-language parity becomes more valuable than bundle control and UI
31
+ composition.
32
+
33
+ CodeMirror 6 benefits: smaller, modular, easier to compose inside the existing
34
+ React/Vite console, more controllable for mobile and constrained panels, and
35
+ well suited to incremental viewer, diagnostics, diff preview, and governed-save
36
+ slices. Costs: LSP support is less turnkey than Monaco and users expecting VS
37
+ Code behavior may notice missing commands.
38
+
39
+ Monaco benefits: closer to VS Code expectations with mature TypeScript and
40
+ JavaScript language behavior, diagnostics, hover, completion, symbols, and
41
+ go-to-definition. Costs: heavier runtime, worker/CSP complexity, harder mobile
42
+ composition, and a stronger pull toward an IDE-like footprint.
43
+
44
+ Adopt CodeMirror 6 for the first implementation slices. Revisit Monaco after
45
+ the read-only viewer, diff integration, and governed write contract are proven.
46
+ The LSP bridge contract should be editor-neutral so Monaco can be introduced
47
+ later without changing policy, workspace, or evidence boundaries.
48
+
49
+ ## Architecture Boundary
50
+
51
+ ```mermaid
52
+ flowchart LR
53
+ ui["Web console editor shell"]
54
+ context["Orchestra context sidebar"]
55
+ api["Editor API contract"]
56
+ policy["Policy gate service"]
57
+ workspace["Workspace file service"]
58
+ git["Git diff and timeline service"]
59
+ lsp["LSP bridge supervisor"]
60
+ server["Language server process"]
61
+ evidence["Evidence and review records"]
62
+
63
+ ui --> api
64
+ context --> api
65
+ api --> policy
66
+ api --> workspace
67
+ api --> git
68
+ api --> lsp
69
+ lsp --> server
70
+ policy --> evidence
71
+ workspace --> evidence
72
+ git --> evidence
73
+ ```
74
+
75
+ The web console must remain a client of stable JSON contracts. The browser does
76
+ not read arbitrary files directly, spawn processes, or decide write policy.
77
+
78
+ ## LSP Bridge Contract
79
+
80
+ The LSP bridge is a local or SaaS-side service boundary that mediates language
81
+ server lifecycle, document sync, diagnostics, and language requests.
82
+
83
+ Required responsibilities:
84
+
85
+ - accept only workspace-relative paths that resolve inside the active workspace;
86
+ - require task id and editor session id for every opened document;
87
+ - start language servers through array-based process APIs, never shell
88
+ interpolation;
89
+ - keep one supervised language-server pool per workspace, language, and tenant
90
+ boundary;
91
+ - enforce startup timeout, idle shutdown, max memory, max files, max document
92
+ size, and bounded request concurrency;
93
+ - redact or suppress diagnostics that expose internal absolute paths or secret
94
+ values;
95
+ - degrade to syntax-only editing when a language server is unavailable;
96
+ - emit lifecycle and diagnostic summaries that can be attached as evidence.
97
+
98
+ Initial target: TypeScript and JavaScript through the project-local TypeScript
99
+ server or a pinned LSP-compatible wrapper. Extension targets are Python
100
+ through pyright, Java through jdtls, .NET through OmniSharp or Roslyn LSP, Apex
101
+ through a Salesforce language server if licensing and setup allow it, and custom
102
+ domain servers through future extension manifests.
103
+
104
+ LSP messages must never be trusted as policy input. They can inform diagnostics
105
+ and navigation, but write permission remains owned by the policy gate service.
106
+
107
+ ## Workspace Isolation
108
+
109
+ All file operations must be scoped to an active workspace root resolved by the
110
+ server.
111
+
112
+ Local mode:
113
+
114
+ - bind local services to `127.0.0.1`;
115
+ - reject absolute paths, traversal, symlinks that escape the workspace, and
116
+ generated or secret-sensitive paths unless explicitly allowlisted;
117
+ - use existing task and evidence state under `.agent-workflow/` as the durable
118
+ traceability source;
119
+ - keep language servers local to the workspace and terminate them when the
120
+ workspace session closes.
121
+
122
+ SaaS mode:
123
+
124
+ - isolate tenants by account, workspace, runtime sandbox, storage prefix, and
125
+ language-server process boundary;
126
+ - enforce data residency before source text or diagnostics cross regions;
127
+ - avoid shared language-server processes across tenants;
128
+ - store only policy-approved evidence summaries unless the user explicitly
129
+ attaches file snippets or diffs;
130
+ - require audit records for open, preview, save request, policy decision, write,
131
+ rollback, and evidence attachment events.
132
+
133
+ ## Governed Edit Contract
134
+
135
+ MVP starts read-only. Edit mode is a deliberate transition with visible task and
136
+ policy state.
137
+
138
+ Open file request fields: `taskId`, `workspaceId`, `relativePath`, `mode`
139
+ (`readOnly` or `editIntent`), and optional `selection`, `contextPackId`, and
140
+ `role`.
141
+
142
+ Save request fields: `taskId`, `workspaceId`, `relativePath`, `baseRevision`,
143
+ `proposedContentHash`, `patch`, `userIntent`, and `policyAcknowledgements`.
144
+
145
+ Save response fields: `decision` (`allowed`, `blocked`, or `needsReview`),
146
+ `diffSummary`, `policyFindings`, `evidenceId`, `rollbackHint`, and
147
+ `nextActions`.
148
+
149
+ Policy checks before write:
150
+
151
+ - task exists, has backlog item, and is active or explicitly selected;
152
+ - path is inside owned write scope for the task;
153
+ - file is not locked by another role or workflow;
154
+ - file is not a release bump file unless the task permits release ownership;
155
+ - generated files require source-of-truth confirmation;
156
+ - security-sensitive paths require Security review;
157
+ - save is based on current file revision or requires conflict resolution;
158
+ - diff preview is acknowledged before write.
159
+
160
+ Every write must create or update a task-scoped diff record and evidence hook.
161
+ The UI should offer rollback guidance based on Git state, but it should not
162
+ perform destructive Git operations without a separate approval flow.
163
+
164
+ ## UX Flow
165
+
166
+ Primary user: a human operator reviewing or making a governed task-scoped edit
167
+ from the local or SaaS web console.
168
+
169
+ MVP flow: user selects an active task; the console shows acceptance criteria,
170
+ owned paths, gates, related files, and evidence gaps; the user opens a related
171
+ file in read-only mode; the editor shows syntax highlighting, diagnostics when
172
+ available, and a task context sidebar; the user requests edit mode; the console
173
+ shows write policy status, locks, and required reviewers; the user edits,
174
+ previews a diff, submits a save request, receives an allowed, blocked, or
175
+ needs-review decision, and gets an evidence link plus next steps.
176
+
177
+ Responsive behavior:
178
+
179
+ - mobile defaults to task context, file list, and read-only code view with
180
+ collapsible diagnostics;
181
+ - tablet uses stacked editor and context panels;
182
+ - desktop uses three regions: file/navigation rail, editor/diff, and Orchestra
183
+ context sidebar;
184
+ - no critical action should depend on horizontal scrolling;
185
+ - keyboard users can open files, search, inspect diagnostics, preview diff,
186
+ request edit mode, and submit or cancel saves.
187
+
188
+ Required states:
189
+
190
+ - loading file and loading diagnostics;
191
+ - empty related files;
192
+ - language server unavailable with syntax-only fallback;
193
+ - policy blocked with clear next action;
194
+ - conflict detected with reload or compare options;
195
+ - save succeeded with evidence link;
196
+ - save failed without exposing stack traces or internal paths.
197
+
198
+ ## Security Constraints
199
+
200
+ Security review is mandatory before implementation because this feature touches
201
+ file paths, process execution, workspace source code, secrets, network calls,
202
+ and future multi-tenant boundaries.
203
+
204
+ Non-negotiables:
205
+
206
+ - no shell interpolation for language server startup or Git operations;
207
+ - validate and normalize every path server-side;
208
+ - never expose stack traces, host paths, environment variables, or raw process
209
+ errors to the browser;
210
+ - scan proposed diffs for configured secret patterns before write;
211
+ - treat workspace files and LSP responses as untrusted input;
212
+ - sanitize markdown, diagnostics, and hover content before rendering;
213
+ - apply content security policy before enabling Monaco workers or remote
214
+ extension assets;
215
+ - fail closed when policy, path validation, revision checks, secret scan, or
216
+ audit write fails;
217
+ - keep local ports bound to `127.0.0.1` by default;
218
+ - require explicit tenant and data residency controls before SaaS rollout.
219
+
220
+ ## QA Evidence Strategy
221
+
222
+ The spike output is validated by review evidence. Implementation stories need
223
+ observable acceptance evidence.
224
+
225
+ Recommended automated coverage:
226
+
227
+ - unit tests for path normalization, task write-scope policy, save contract,
228
+ revision conflict handling, and LSP lifecycle state transitions;
229
+ - contract tests for editor API request and response shapes;
230
+ - integration tests with fake language-server processes for diagnostics,
231
+ timeout, crash, unavailable server, and idle shutdown;
232
+ - Playwright tests for read-only viewer, responsive layout, keyboard flow,
233
+ policy-blocked save, conflict recovery, and successful evidence link;
234
+ - security tests for traversal, symlink escape, secret diff rejection, unsafe
235
+ diagnostic rendering, and blocked process arguments.
236
+
237
+ Evidence required per implementation story:
238
+
239
+ - exact commands and pass/fail results;
240
+ - AC-to-evidence matrix;
241
+ - screenshots or traces for desktop and mobile editor flows;
242
+ - sample diff/evidence artifact;
243
+ - security review result for file/process/network changes;
244
+ - documented deferred language support when a language server is unavailable.
245
+
246
+ ## Implementation Slices
247
+
248
+ 1. Read-only code viewer and file open contract: CodeMirror 6 surface, syntax
249
+ highlighting, loading/empty/error states, path validation, task association,
250
+ and Playwright smoke.
251
+ 2. Task context sidebar: active task, backlog item, acceptance criteria, roles,
252
+ owned paths, context-pack references, evidence gaps, and gate warnings.
253
+ 3. Git diff and task timeline integration: revision metadata, diff preview,
254
+ task-scoped file timeline, conflict detection, and evidence hook.
255
+ 4. TypeScript/JavaScript LSP bridge MVP: supervised lifecycle, diagnostics,
256
+ hover, completion, go-to-definition, fallback states, and fake LSP tests.
257
+ 5. Governed edit mode: edit intent, patch submission, policy checks, diff
258
+ acknowledgement, save response, blocked UX, and needs-review UX.
259
+ 6. Security hardening: traversal and symlink protection, secret scanning,
260
+ process allowlist, diagnostic sanitization, CSP review, and local binding
261
+ checks.
262
+ 7. SaaS isolation design: tenant sandboxing, process isolation, storage and data
263
+ residency policy, audit logs, quota controls, and abuse controls.
264
+ 8. Language extension framework: server capability manifest, health status,
265
+ per-language setup guidance, and extension points.
266
+
267
+ ## Open Risks
268
+
269
+ - LSP servers execute project-aware code paths and can be expensive or unsafe if
270
+ not tightly supervised.
271
+ - Monaco may be required later if CodeMirror extension quality does not meet
272
+ user expectations for TypeScript-heavy projects.
273
+ - SaaS editing has materially higher tenant isolation, data residency, and audit
274
+ requirements than local mode.
275
+ - Secret detection can produce false negatives and should not be the only
276
+ control before writing.
277
+ - Generated-file editing can violate source-of-truth contracts unless policy
278
+ gates are strict.
279
+
280
+ ## Recommended Next Stories
281
+
282
+ - GH-447-A: Build read-only CodeMirror file viewer with task-scoped open
283
+ contract.
284
+ - GH-447-B: Add Orchestra task context sidebar for editor sessions.
285
+ - GH-447-C: Add Git diff preview and task-scoped file timeline.
286
+ - GH-447-D: Implement TypeScript/JavaScript LSP bridge MVP with fake LSP tests.
287
+ - GH-447-E: Implement governed edit mode with policy-gated saves.
288
+ - GH-447-F: Add editor security hardening and negative test matrix.
289
+ - GH-447-G: Define SaaS tenant isolation and data residency ADR.
@@ -0,0 +1,80 @@
1
+ # Context Vault
2
+
3
+ Context vault is the planned workspace catalog for source materials that inform
4
+ agent work but should not be pasted directly into every prompt. It covers
5
+ documents, statements of work, PDFs, diagrams, images, audio/video recordings,
6
+ transcripts, and client reference artifacts.
7
+
8
+ The vault is related to context indexing and transcription, but it has a
9
+ different job: it records provenance, sensitivity, retention, ownership, and
10
+ safe consumption rules for project inputs.
11
+
12
+ ## Goals
13
+
14
+ - Register source artifacts with stable metadata and checksums.
15
+ - Classify sensitivity before an artifact is used by an agent.
16
+ - Convert large or binary inputs into bounded summaries, excerpts, transcripts,
17
+ or context packs.
18
+ - Preserve provenance so BA, PO, Architect, QA, and Release can cite which
19
+ artifact informed a requirement, risk, decision, or validation result.
20
+ - Keep raw sensitive inputs out of runtime prompts unless policy explicitly
21
+ allows a bounded excerpt.
22
+
23
+ ## Artifact Metadata
24
+
25
+ Every vault artifact should record:
26
+
27
+ - artifact id and workspace or tenant id;
28
+ - original source, file name, media type, size, checksum, and registered time;
29
+ - owner role or user;
30
+ - sensitivity classification and retention policy;
31
+ - ingestion status, conversion status, redaction status, and error state;
32
+ - derived outputs such as Markdown conversion, transcript, summary, embeddings,
33
+ or context-pack references.
34
+
35
+ ## Consumption Model
36
+
37
+ Agents should not load raw vault artifacts by default. They should request a
38
+ bounded context pack or artifact summary scoped to the active task, role, phase,
39
+ and token budget.
40
+
41
+ The pack should include:
42
+
43
+ - artifact references and provenance links;
44
+ - selected excerpts with inclusion reasons;
45
+ - redaction decisions and omitted-sensitive-data notes;
46
+ - budget summary and truncation indicators;
47
+ - stale or failed-ingestion warnings.
48
+
49
+ ## Security And Privacy
50
+
51
+ Vault ingestion must be tenant-aware and fail closed when classification or
52
+ redaction is uncertain. Secrets, credentials, health data, payment data, and
53
+ other regulated content require explicit policy handling before they can be
54
+ summarized or exposed to a runtime.
55
+
56
+ External conversion or transcription providers are opt-in. Local conversion and
57
+ local transcription should be preferred when a workspace or tenant requires
58
+ offline handling.
59
+
60
+ ## API Shape
61
+
62
+ The implementation should define APIs before storage details:
63
+
64
+ - `vault artifact add` or API equivalent for registering files and metadata;
65
+ - `vault artifact list` with pagination, filtering, status, type, and
66
+ sensitivity filters;
67
+ - `vault artifact show` for metadata and derived-output status;
68
+ - `vault ingest` for conversion, transcription, and redaction jobs;
69
+ - `context pack build` integration that can cite vault artifacts without
70
+ reading raw files broadly.
71
+
72
+ The web console can later expose this as a catalog view, but it should consume
73
+ the same domain services as the CLI/API.
74
+
75
+ ## Related Work
76
+
77
+ - GitHub issue `#449`: context vault epic.
78
+ - GitHub issue `#367`: audio and video transcription evidence skill.
79
+ - GitHub issues `#423` through `#427`: context index, search, bounded context
80
+ packs, redaction, and runtime prompt integration.
@@ -226,6 +226,17 @@ non-Claude, or callback-unavailable contexts return fallback guidance and do not
226
226
  claim native execution. Orchestra does not call Claude Code, Anthropic APIs, or
227
227
  another provider API.
228
228
 
229
+ Runtime-native dispatch also enforces delegation capacity before calling parent
230
+ runtime tools. The dispatcher evaluates actions sequentially, reserves only the
231
+ oldest eligible requested sessions within `maxConcurrentDelegates` and
232
+ `maxSpawnsPerTask`, keeps suspended sessions from opening extra capacity, and
233
+ leaves over-capacity actions queued with structured `checked.capacity` metadata.
234
+ When lifecycle events complete, fail, time out, cancel, or close an active
235
+ session, the next queued action can be promoted to a requested parent action and
236
+ dispatched on the next bounded auto-dispatch pass. This prevents several squads
237
+ or gates from flooding the parent runtime at once while still allowing
238
+ background work to continue as capacity becomes available.
239
+
229
240
  Runtime lifecycle watching is adapter-driven. Each inspected session reports a
230
241
  `watcher` object with adapter id, detection mode, support level, fallback
231
242
  behavior, and the reason a native callback is unavailable. `codex-cli`,
@@ -117,6 +117,7 @@
117
117
  { "title": "Sonar quality gates", "source": "docs/sonar-quality-gates.md", "heading": "Sonar Quality Gates" },
118
118
  { "title": "Sonar architecture model", "source": "docs/sonar-architecture-model.md", "heading": "Sonar Architecture Model" },
119
119
  { "title": "Runtime adapters", "source": "docs/runtime-adapters.md", "heading": "Runtime Adapters" },
120
+ { "title": "Context vault", "source": "docs/context-vault.md", "heading": "Context Vault" },
120
121
  { "title": "Site content workflow", "source": "docs/site-content-workflow.md", "heading": "Public Site Content Workflow" }
121
122
  ]
122
123
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jterrats/open-orchestra",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  "extensions/vscode-open-orchestra",