vgxness 1.19.4 → 1.19.6

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.
@@ -2,7 +2,7 @@ import { canonicalBehaviorContractVersion } from '../behavior/behavior-contract-
2
2
  export const canonicalDefaultAgentName = 'vgxness-manager';
3
3
  export const canonicalOpenCodeDefaultModel = 'openai/gpt-5.5';
4
4
  export const canonicalOpenCodeManagerReasoningEffort = 'high';
5
- export const canonicalPromptContractVersion = 16;
5
+ export const canonicalPromptContractVersion = 17;
6
6
  export const canonicalSddSubagentNames = [
7
7
  'vgxness-sdd-explore',
8
8
  'vgxness-sdd-propose',
@@ -145,9 +145,9 @@ export function createCanonicalOpenCodeSddMcpToolPermissions() {
145
145
  }
146
146
  export function createCanonicalOpenCodeSddSubagentPrompt(name) {
147
147
  const phase = name.replace('vgxness-sdd-', '');
148
- const common = `You are the VGXNESS SDD ${phase} executor, not the orchestrator. Do this phase's work yourself. Do NOT delegate, do NOT call task/delegate, and do NOT launch sub-agents. Use provided SDD artifacts, VGXNESS MCP state, and local repository evidence as needed. Retrieve full artifact content through MCP when the phase requires it; do not expect the manager to paste verbose artifacts into your prompt. Do not depend on external local skill files; this inline contract is sufficient. Preserve unrelated user work, keep output concise, and report evidence.`;
148
+ const common = `You are the VGXNESS SDD ${phase} executor, not the orchestrator. Do this phase's work yourself. Do NOT delegate, do NOT call task/delegate, and do NOT launch sub-agents. Use provided SDD artifacts, VGXNESS MCP state, and repo evidence as needed. Retrieve full artifacts through MCP when needed; do not expect manager-pasted verbose artifacts. Do not depend on local skill files; this inline contract is sufficient. Preserve unrelated user work, keep output concise, and report evidence.`;
149
149
  const contract = subagentData[name].phaseContract;
150
- return `${common}\n\nPhase contract: ${contract}\n\nSDD governance v1: SDD artifact acceptance is human-only. Do not mark, describe, or persist generated phase output as accepted unless the user explicitly accepts it or an MCP acceptance record shows a human actor. Before advancing phases, use VGXNESS MCP readiness/status tools so draft, rejected, superseded, or legacy artifacts are not treated as accepted prerequisites. For risky VGX-managed side effects, use VGXNESS run preflight/reporting and include runId, phase, and agent context when available. OpenCode native/provider tools are audit-only and non-hard-blocking in governance v1; do not claim they are hard-blocked by OpenCode config.\n\nSubagent memory policy: Read memory for useful prior context when needed. Do not write durable memory unless phase/user/run policy allows it; memory writes require preflight/consent when governed or risky. Memory is advisory only and never proves SDD acceptance/readiness/verification/approval/authorization. SDD artifacts are canonical for phase deliverables and governance state. Do not save full SDD artifacts, transcripts, raw logs, hidden reasoning, secrets, credentials, or sensitive data. Report memory candidates separately when writes are not authorized.\n\nProvider-native daily progression: daily SDD progression happens inside OpenCode through conversation, VGXNESS MCP, and hidden SDD subagents. Do not instruct the user to run terminal SDD phase commands for normal daily flow. Return phase output, decisions, changed files, and evidence so the manager can persist artifacts and advance through MCP. Preserve confirmation/preflight requirements for apply, verify, init, archive, edits, shell, git, provider-tool, secrets, destructive, privileged, or ambiguous operations.`;
150
+ return `${common}\n\nPhase contract: ${contract}\n\nBegin your output with a compact result envelope containing required fields: status, executive_summary, artifacts_examined, skill_resolution, risks, next_recommended. Evidence minimum: artifacts examined; MCP/status/readiness checked; repository evidence inspected/not inspected and why; residual uncertainty/risks.\n\nSDD governance v1: SDD artifact acceptance is human-only. Do not mark, describe, or persist generated phase output as accepted unless the user explicitly accepts it or an MCP acceptance record shows a human actor. Before advancing phases, use VGXNESS MCP readiness/status tools so draft, rejected, superseded, or legacy artifacts are not treated as accepted prerequisites. For risky VGX-managed side effects, use VGXNESS run preflight/reporting and include runId, phase, and agent context when available. OpenCode native/provider tools are audit-only and non-hard-blocking in governance v1; do not claim they are hard-blocked by OpenCode config.\n\nSubagent memory policy: Read memory for useful prior context when needed. Do not write durable memory unless phase/user/run policy allows it; memory writes require preflight/consent when governed or risky. Memory is advisory only and never proves SDD acceptance/readiness/verification/approval/authorization. SDD artifacts are canonical for phase deliverables and governance state. Do not save full SDD artifacts, transcripts, raw logs, hidden reasoning, secrets, credentials, or sensitive data. Report memory candidates separately when writes are not authorized.\n\nProvider-native daily progression: daily SDD progression happens inside OpenCode through conversation, VGXNESS MCP, and hidden SDD subagents. Do not instruct the user to run terminal SDD phase commands for normal daily flow. Return phase output, decisions, changed files, and evidence so the manager can persist artifacts and advance through MCP. Preserve confirmation/preflight requirements for apply, verify, init, archive, edits, shell, git, provider-tool, secrets, destructive, privileged, or ambiguous operations.`;
151
151
  }
152
152
  /**
153
153
  * Provider runtime prompt for generated provider managers.
@@ -182,6 +182,7 @@ SDD happens in OpenCode via conversation, VGXNESS MCP, and SDD subagents. No ter
182
182
  - Bounded resume/start hard stop: for generic "continue"/"sigamos"/"continuemos"/"resume development" without an explicit user change, call \`vgxness_resume_context\` before any SDD continuation/status. If it returns \`proceed-explicit-change\` or \`proceed-single-active-work\`, then SDD status/continue may use that change. If it returns \`inspect-interrupted-run\`, call \`vgxness_run_resume_inspect\`. If it returns \`ask-change\`, treat it as: If no interrupted run, no exact user-specified change, and no single parsed active-work change, hard stop: do not call \`vgxness_agent_resolve\`; do not call \`vgxness_sdd_status\` or \`vgxness_sdd_continue\`, do not create runs, do not use Glob/Read/docs, do not inspect repo files/native repo tools, do not delegate to SDD subagents, do not start runs, or use \`skill_index\`/\`skill_search\` fallback; ask one question: "¿qué cambio retomamos?".
183
183
  - Proposal clarity: if product/business clarity is missing, run a proposal question round.
184
184
  - SDD artifacts: guide with \`vgxness_sdd_next\`/\`vgxness_sdd_cockpit\`; list/read with \`vgxness_sdd_get_artifact\`/\`vgxness_sdd_list_artifacts\`; prefer \`payloadMode: "compact"\` so primary context stays clean; use verbose only when required, preferably inside the delegated phase subagent. Save with \`vgxness_sdd_save_artifact\` after the right flow. Use \`vgxness_sdd_reopen_artifact\` only for rejected artifacts returning to draft, with explicit human actor/audit context.
185
+ - Delegated phase outputs: inspect delegated result-envelope completeness before SDD artifact persistence or phase advancement (status, executive_summary, artifacts_examined, skill_resolution, risks, next_recommended); this is prompt guidance only, not runtime parsing/rejection.
185
186
  - Trusted draft autorun: when the exact \`proposal\` artifact is already accepted, run \`spec -> design -> tasks\` without extra human confirmation via subagents; save drafts with \`vgxness_sdd_save_artifact\`. This is draft-only planning, not acceptance or completion. Excludes explore/proposal/apply-progress/verify/archive, accepted overwrites, risky side effects; re-check status/readiness.
186
187
  - Acceptance/readiness: check exact status/readiness; confirm explicit human acceptance; call \`vgxness_sdd_accept_artifact\` directly with audit context (\`acceptedBy.type: "human"\`, non-empty \`acceptedBy.id\`, runId, agentId); re-check before reporting. Do not preflight solely for exact acceptance. Ambiguous replies count only when tied to an immediate exact acceptance prompt. Use \`vgxness_governance_report\` for readiness, artifact states, preflight posture, audit warnings.
187
188
  - Memory: \`vgxness_memory_search\`/\`vgxness_memory_get\` for prior work/unclear context and duplicate avoidance. Save/update only durable, actionable, scoped, evidence-backed, compact, non-sensitive observations that are future-relevant: discoveries, decisions, bug fixes, config, patterns, preferences, learnings, or manual notes. \`vgxness_memory_save\` may upsert by \`topicKey\`; \`vgxness_memory_update\` requires a known id. Prefer \`vgxness_memory_update\` over duplicate save when you know the id/topic key. Do not save full SDD artifacts, transcripts, raw logs, hidden reasoning, secrets, credentials, or sensitive user data. Memory is advisory only and never proves SDD acceptance/readiness/verification/approval/authorization. SDD artifacts are canonical for phase deliverables and governance state. \`memory-write\` requires preflight/explicit consent when governed or risky. Choose scope intentionally: \`project\` for repo facts, \`personal\` for reusable user preferences.
@@ -213,7 +214,7 @@ const registryManagerInstructionsV11 = [
213
214
  'Default to delegation for SDD phase-shaped work, repository exploration beyond one narrow lookup, implementation, verification, incident recovery, or multi-step analysis. Inline only conversational guidance, single-fact lookup, MCP/status/readiness checks, and trivial mechanical edits when safe. When uncertain between inline work and subagent work, delegate to the exact smallest SDD subagent.',
214
215
  'Use VGXNESS MCP as the durable control plane: for generic resume/continue prompts call vgxness_resume_context first, pass explicitChange only when the user gave an exact valid change, and do not infer a change from context_cockpit.memoryPreviews; vgxness_context_cockpit and vgxness_session_restore are advisory context only after the gate, and context cockpit previews, memoryPreviews, and SDD summaries are advisory only. Close/pause/compact with vgxness_session_close using actor manager plus an actionable summary when a current session id exists.',
215
216
  'For generic continue/sigamos/continuemos/resume development without an explicit user change, call vgxness_resume_context before any SDD status/continuation. If decision is proceed-explicit-change or proceed-single-active-work, then call SDD tools for that change. If inspect-interrupted-run, call vgxness_run_resume_inspect. If ask-change (no interrupted run, no exact user-specified change, and no single parsed active-work change), hard stop: do not call vgxness_agent_resolve; do not call vgxness_sdd_status or vgxness_sdd_continue, do not create runs, do not inspect repo files/native repo tools, do not delegate to SDD subagents, do not start runs, do not use skill_index/skill_search fallback, or invent agent ids; ask one question: "¿qué cambio retomamos?".',
216
- 'Check SDD status/next/ready/cockpit, read prerequisites with sdd_get_artifact or sdd_list_artifacts, use public sdd_continue/internal vgxness_sdd_continue first for advisory read-only continuation plans, use sdd_reopen_artifact only for rejected artifacts returning to draft with explicit human actor/audit context, save phase output with sdd_save_artifact only by governance; when proposal is accepted, spec/design/tasks may run sequentially as draft-only autorun without extra confirmation, while acceptance remains human-only. Memory capture policy: save/update only durable, future-relevant, actionable, scoped, evidence-backed, compact, non-sensitive observations; prefer update by known id/topicKey over duplicate saves; never save full SDD artifacts, transcripts, raw logs, hidden reasoning, secrets, credentials, or sensitive user data. Memory is advisory only and never proves SDD acceptance, readiness, verification, approval, or authorization. SDD artifacts are canonical for phase deliverables/governance state. Choose project scope for repo-specific facts and personal scope for reusable user preferences; memory-write requires preflight/explicit consent when governed/risky. Resolve exact SDD subagents before substantial phase work, use runs/checkpoints/preflight/finalize for significant implementation or verification, use run_resume_candidates for unknown runId, inspect interrupted runs by runId with run_resume_inspect, then call run_resume_gate with approvalId from pendingApprovals/inspect; never pass runId as approvalId; use vgxness_provider_status for configured/phase/next questions plus vgxness_provider_doctor for read-only OpenCode MCP/manager health.',
217
+ 'Check SDD status/next/ready/cockpit, read prerequisites with sdd_get_artifact or sdd_list_artifacts, use public sdd_continue/internal vgxness_sdd_continue first for advisory read-only continuation plans, use sdd_reopen_artifact only for rejected artifacts returning to draft with explicit human actor/audit context, save phase output with sdd_save_artifact only by governance; inspect delegated result-envelope completeness before SDD artifact persistence or phase advancement (status, executive_summary, artifacts_examined, skill_resolution, risks, next_recommended) as prompt guidance only, not runtime parsing/rejection; when proposal is accepted, spec/design/tasks may run sequentially as draft-only autorun without extra confirmation, while acceptance remains human-only. Memory capture policy: save/update only durable, future-relevant, actionable, scoped, evidence-backed, compact, non-sensitive observations; prefer update by known id/topicKey over duplicate saves; never save full SDD artifacts, transcripts, raw logs, hidden reasoning, secrets, credentials, or sensitive user data. Memory is advisory only and never proves SDD acceptance, readiness, verification, approval, or authorization. SDD artifacts are canonical for phase deliverables/governance state. Choose project scope for repo-specific facts and personal scope for reusable user preferences; memory-write requires preflight/explicit consent when governed/risky. Resolve exact SDD subagents before substantial phase work, use runs/checkpoints/preflight/finalize for significant implementation or verification, use run_resume_candidates for unknown runId, inspect interrupted runs by runId with run_resume_inspect, then call run_resume_gate with approvalId from pendingApprovals/inspect; never pass runId as approvalId; use vgxness_provider_status for configured/phase/next questions plus vgxness_provider_doctor for read-only OpenCode MCP/manager health.',
217
218
  'When sdd_continue/vgxness_sdd_continue returns recommendedActions, prefer the first safe action with agentCallable true and humanOnly false; use targetTool plus suggestedArgs as the starting point, and stop for requiresHumanConfirmation, requiresProviderWriteConsent, requiresPreflight, ambiguous, destructive, privileged, external, or outside-approval actions. For readiness, use cockpit/status/readiness to distinguish missing, draft, ready, blocked, and accepted; never infer acceptance. For provider evidence, report providerEvidence.evidenceLevel, hostToolPresenceVerified, notes, and limitations; do not claim true host presence unless evidence explicitly verifies it.',
218
219
  'Prefer payloadMode=compact for manager-facing status/context reads, SDD artifact reads/lists, and activation handoffs so the primary context stays clean; request payloadMode=verbose only when full artifact contents, provider payloads, or skill context are actually needed, preferably inside delegated phase subagents.',
219
220
  'MCP sdd_continue must not execute providers, create runs, mutate artifacts, write provider config/openspec, bypass human acceptance, or treat draft-run as apply-progress.',
@@ -225,7 +226,7 @@ const subagentData = {
225
226
  'vgxness-sdd-propose': { seedDescription: 'Creates focused change proposals from exploration findings.', seedInstructions: 'You are the proposal phase executor, not the orchestrator. Do not delegate. Create a focused SDD proposal from exploration evidence. Do not implement code changes. Identify scope, tradeoffs, non-goals, and acceptance direction.', capabilities: ['sdd-proposal', 'proposal-planning', 'scope-definition'], permissions: { read: 'allow', edit: 'deny', shell: 'deny', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:proposal'], skills: ['vgxness-sdd-proposal'], phaseContract: 'Create or refine a focused SDD proposal from exploration evidence. Do not implement code changes. Include scope, tradeoffs, non-goals, and acceptance direction.' },
226
227
  'vgxness-sdd-spec': { seedDescription: 'Writes detailed requirements and acceptance criteria for SDD changes.', seedInstructions: 'You are the spec phase executor, not the orchestrator. Do not delegate. Write a detailed SDD specification with requirements, acceptance criteria, edge cases, and out-of-scope items. Do not implement code changes.', capabilities: ['sdd-specification', 'requirements', 'acceptance-criteria'], permissions: { read: 'allow', edit: 'deny', shell: 'deny', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:spec'], skills: ['vgxness-sdd-spec'], phaseContract: 'Write requirements, acceptance criteria, edge cases, and out-of-scope items. Do not implement code changes.' },
227
228
  'vgxness-sdd-design': { seedDescription: 'Creates technical design from accepted proposals and accepted or trusted draft specs.', seedInstructions: 'You are the design phase executor, not the orchestrator. Do not delegate. Create a technical design grounded in the repository. Identify affected modules, data shapes, risks, rollout, and verification strategy. Do not implement code changes.', capabilities: ['sdd-design', 'technical-design', 'architecture-planning'], permissions: { read: 'allow', edit: 'deny', shell: 'ask', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:design'], skills: ['vgxness-sdd-design'], phaseContract: 'Create technical design grounded in the repository: affected modules, data shapes, safety, rollout, and verification. You may use an accepted spec or a trusted draft spec produced in the manager autorun chain. Do not implement code changes.' },
228
- 'vgxness-sdd-tasks': { seedDescription: 'Breaks accepted or trusted draft specs and designs into implementation tasks.', seedInstructions: 'You are the tasks phase executor, not the orchestrator. Do not delegate. Break the SDD spec/design into small, ordered, testable implementation tasks. Do not implement code changes.', capabilities: ['sdd-tasks', 'task-breakdown', 'implementation-planning'], permissions: { read: 'allow', edit: 'deny', shell: 'deny', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:tasks'], skills: ['vgxness-sdd-tasks'], phaseContract: 'Break accepted or trusted draft spec/design into small ordered testable implementation tasks. Do not implement code changes.' },
229
+ 'vgxness-sdd-tasks': { seedDescription: 'Breaks accepted or trusted draft specs and designs into implementation tasks.', seedInstructions: 'You are the tasks phase executor, not the orchestrator. Do not delegate. Break the SDD spec/design into small, ordered, testable implementation tasks. Include a Review Workload Forecast covering expected review size, risk, and reviewer burden. Do not implement code changes.', capabilities: ['sdd-tasks', 'task-breakdown', 'implementation-planning'], permissions: { read: 'allow', edit: 'deny', shell: 'deny', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:tasks'], skills: ['vgxness-sdd-tasks'], phaseContract: 'Break accepted or trusted draft spec/design into small ordered testable implementation tasks. Include a Review Workload Forecast covering expected review size, risk, and reviewer burden. Do not implement code changes.' },
229
230
  'vgxness-sdd-apply': { seedDescription: 'Implements code changes from SDD task definitions.', seedInstructions: 'You are the apply phase executor, not the orchestrator. Implement only the assigned SDD tasks directly. Do not delegate. Keep changes small, preserve unrelated user work, run focused checks when authorized, and report changed files plus verification evidence.', capabilities: ['sdd-apply', 'implementation', 'code-change'], permissions: { read: 'allow', edit: 'ask', shell: 'allow', git: 'ask', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:apply-progress'], skills: ['vgxness-sdd-apply'], phaseContract: 'Implement only assigned SDD tasks. Preserve unrelated dirty files and user work. Use focused tests when authorized. Report changed files, tests/evidence, and residual risks.' },
230
231
  'vgxness-sdd-verify': { seedDescription: 'Validates implementation against specs, tasks, and evidence.', seedInstructions: 'You are the verify phase executor, not the orchestrator. Do not delegate. Verify the implementation against SDD artifacts. Prefer focused local tests, inspect evidence, and report residual risk. Do not implement unrelated changes.', capabilities: ['sdd-verify', 'verification', 'test-review', 'risk-review'], permissions: { read: 'allow', edit: 'deny', shell: 'ask', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:verify'], skills: ['vgxness-sdd-verify'], phaseContract: 'Validate implementation against SDD artifacts and task acceptance criteria. Prefer focused local tests and evidence review. Do not implement unrelated changes.' },
231
232
  'vgxness-sdd-archive': { seedDescription: 'Archives completed SDD change artifacts and outcomes.', seedInstructions: 'You are the archive phase executor, not the orchestrator. Do not delegate. Archive completed SDD artifacts and summarize final outcome, verification, and follow-ups. Confirm before writes beyond the requested archive artifact.', capabilities: ['sdd-archive', 'artifact-archive', 'release-notes'], permissions: { read: 'allow', edit: 'ask', shell: 'deny', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:archive'], skills: ['vgxness-sdd-archive'], phaseContract: 'Archive completed SDD outcome with summary, verification evidence, follow-ups, and residual risks. Confirm before any repository writes beyond the requested archive artifact.' },
@@ -0,0 +1,84 @@
1
+ export function buildResumeAfterApprovalResult(input) {
2
+ const operationKind = stringFromObject(input.executorOutput, 'operationKind') ?? operationKindFromOperation(input.operation);
3
+ const command = operationKind === 'allowlisted-command' ? extractAllowlistedCommandMetadata(input.executorOutput) : undefined;
4
+ return {
5
+ kind: 'resume-after-approval-result',
6
+ version: 1,
7
+ operationKind,
8
+ runId: input.runId,
9
+ approvalId: input.approvalId,
10
+ attemptId: input.attemptId,
11
+ permissionEventId: input.permissionEventId,
12
+ pendingExecutionEventId: input.pendingExecutionEventId,
13
+ operationFingerprint: input.operationFingerprint,
14
+ executor: input.executorName,
15
+ status: input.status,
16
+ ...(command === undefined ? {} : { command }),
17
+ error: input.error === undefined ? null : { code: input.error.code, message: input.error.message },
18
+ safety: buildSafety(input.executorOutput),
19
+ };
20
+ }
21
+ function extractAllowlistedCommandMetadata(output) {
22
+ if (!isObject(output))
23
+ return undefined;
24
+ const command = isObject(output.command) ? output.command : output;
25
+ const commandId = stringField(command.commandId) ?? stringField(output.commandId);
26
+ const argv = stringArray(command.argv) ?? stringArray(output.argv);
27
+ if (commandId === undefined || argv === undefined)
28
+ return undefined;
29
+ const result = { commandId, argv };
30
+ setOptionalNumberOrNull(result, 'exitCode', command.exitCode);
31
+ setOptionalStringOrNull(result, 'signal', command.signal);
32
+ setOptionalBoolean(result, 'timedOut', command.timedOut);
33
+ setOptionalBoolean(result, 'outputTruncated', command.outputTruncated);
34
+ setOptionalNumber(result, 'stdoutBytes', command.stdoutBytes);
35
+ setOptionalNumber(result, 'stderrBytes', command.stderrBytes);
36
+ return result;
37
+ }
38
+ function buildSafety(output) {
39
+ const source = isObject(output) && isObject(output.command) && isObject(output.command.safety) ? output.command.safety : isObject(output) && isObject(output.safety) ? output.safety : undefined;
40
+ return {
41
+ metadataOnly: true,
42
+ rawStdoutPersisted: false,
43
+ rawStderrPersisted: false,
44
+ providerPayloadPersisted: false,
45
+ executorOutputWhitelisted: true,
46
+ ...(typeof source?.boundedProcess === 'boolean' ? { boundedProcess: source.boundedProcess } : {}),
47
+ ...(typeof source?.shellDisabled === 'boolean' ? { shellDisabled: source.shellDisabled } : {}),
48
+ ...(typeof source?.argvArrayOnly === 'boolean' ? { argvArrayOnly: source.argvArrayOnly } : {}),
49
+ ...(typeof source?.providerConfigWritesBlocked === 'boolean' ? { providerConfigWritesBlocked: source.providerConfigWritesBlocked } : {}),
50
+ ...(typeof source?.createsSandbox === 'boolean' ? { createsSandbox: source.createsSandbox } : {}),
51
+ ...(typeof source?.createsWorktree === 'boolean' ? { createsWorktree: source.createsWorktree } : {}),
52
+ };
53
+ }
54
+ function operationKindFromOperation(operation) {
55
+ return isObject(operation.input) && typeof operation.input.operationKind === 'string' ? operation.input.operationKind : 'generic-operation';
56
+ }
57
+ function stringFromObject(value, key) {
58
+ return isObject(value) ? stringField(value[key]) : undefined;
59
+ }
60
+ function stringField(value) {
61
+ return typeof value === 'string' ? value : undefined;
62
+ }
63
+ function stringArray(value) {
64
+ return Array.isArray(value) && value.every((item) => typeof item === 'string') ? value : undefined;
65
+ }
66
+ function setOptionalNumber(target, key, value) {
67
+ if (typeof value === 'number')
68
+ target[key] = value;
69
+ }
70
+ function setOptionalBoolean(target, key, value) {
71
+ if (typeof value === 'boolean')
72
+ target[key] = value;
73
+ }
74
+ function setOptionalNumberOrNull(target, key, value) {
75
+ if (typeof value === 'number' || value === null)
76
+ target[key] = value;
77
+ }
78
+ function setOptionalStringOrNull(target, key, value) {
79
+ if (typeof value === 'string' || value === null)
80
+ target[key] = value;
81
+ }
82
+ function isObject(value) {
83
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
84
+ }
@@ -7,6 +7,7 @@ import { evaluateOperationRetry as evaluateOperationRetryPolicy } from './operat
7
7
  import { AllowlistedApplyProgressCommandExecutor } from '../workflows/command-allowlist-adapter.js';
8
8
  import { RunRepository, } from './repositories/runs.js';
9
9
  import { buildRunInsights, buildRunOperatorResumePlan } from './run-insights.js';
10
+ import { buildResumeAfterApprovalResult } from './resume-after-approval-result.js';
10
11
  const preflightSafety = {
11
12
  operationExecuted: false,
12
13
  executorInvoked: false,
@@ -459,7 +460,19 @@ export class RunService {
459
460
  const executed = input.executor.execute({ runId: approval.value.runId, operation });
460
461
  if (!executed.ok) {
461
462
  const error = { code: executed.error.code, message: executed.error.message };
462
- const attempt = this.runs.completeOperationAttempt({ attemptId: reserved.value.id, status: 'failed', error });
463
+ const result = buildResumeAfterApprovalResult({
464
+ runId: approval.value.runId,
465
+ approvalId: approval.value.id,
466
+ attemptId: reserved.value.id,
467
+ permissionEventId: permissionEvent.id,
468
+ pendingExecutionEventId: pendingExecutionEvent.id,
469
+ operationFingerprint: replayGuard.operationFingerprint,
470
+ executorName: input.executor.name,
471
+ operation,
472
+ status: 'failed',
473
+ error,
474
+ });
475
+ const attempt = this.runs.completeOperationAttempt({ attemptId: reserved.value.id, status: 'failed', output: result, error });
463
476
  if (!attempt.ok)
464
477
  return attempt;
465
478
  const executionEvent = this.runs.appendEvent({
@@ -478,6 +491,7 @@ export class RunService {
478
491
  operationFingerprint: replayGuard.operationFingerprint,
479
492
  resumedFromApprovalId: approval.value.id,
480
493
  executorInvoked: true,
494
+ result,
481
495
  error,
482
496
  }),
483
497
  relatedType: 'approval',
@@ -486,7 +500,7 @@ export class RunService {
486
500
  if (!executionEvent.ok)
487
501
  return { ok: false, error: executionEvent.error };
488
502
  const linkedAttempt = this.runs.attachAttemptResultEvent(attempt.value.id, executionEvent.value.id);
489
- const evidence = appendApplyProgressAllowlistEvidenceIfNeeded(this.runs, approval.value.id, permissionEvent, pendingExecutionEvent, linkedAttempt.ok ? linkedAttempt.value : attempt.value, executionEvent.value, replayGuard.operationFingerprint, input.executor.name, operation, undefined, error);
503
+ const evidence = appendApplyProgressAllowlistEvidenceIfNeeded(this.runs, approval.value.id, permissionEvent, pendingExecutionEvent, linkedAttempt.ok ? linkedAttempt.value : attempt.value, executionEvent.value, replayGuard.operationFingerprint, input.executor.name, operation, result);
490
504
  if (!evidence.ok)
491
505
  return { ok: false, error: evidence.error };
492
506
  return {
@@ -498,12 +512,25 @@ export class RunService {
498
512
  attempt: linkedAttempt.ok ? linkedAttempt.value : attempt.value,
499
513
  executionEvent: executionEvent.value,
500
514
  status: 'failed',
515
+ output: result,
501
516
  ...(evidence.value === undefined ? {} : evidence.value),
502
517
  },
503
518
  };
504
519
  }
505
520
  const output = executed.value.output;
506
- const attempt = this.runs.completeOperationAttempt({ attemptId: reserved.value.id, status: 'succeeded', ...(output === undefined ? {} : { output }) });
521
+ const result = buildResumeAfterApprovalResult({
522
+ runId: approval.value.runId,
523
+ approvalId: approval.value.id,
524
+ attemptId: reserved.value.id,
525
+ permissionEventId: permissionEvent.id,
526
+ pendingExecutionEventId: pendingExecutionEvent.id,
527
+ operationFingerprint: replayGuard.operationFingerprint,
528
+ executorName: input.executor.name,
529
+ operation,
530
+ status: 'succeeded',
531
+ ...(output === undefined ? {} : { executorOutput: output }),
532
+ });
533
+ const attempt = this.runs.completeOperationAttempt({ attemptId: reserved.value.id, status: 'succeeded', output: result });
507
534
  if (!attempt.ok)
508
535
  return attempt;
509
536
  const executionEvent = this.runs.appendEvent({
@@ -522,7 +549,7 @@ export class RunService {
522
549
  operationFingerprint: replayGuard.operationFingerprint,
523
550
  resumedFromApprovalId: approval.value.id,
524
551
  executorInvoked: true,
525
- output: output ?? null,
552
+ result,
526
553
  }),
527
554
  relatedType: 'approval',
528
555
  relatedId: approval.value.id,
@@ -530,7 +557,7 @@ export class RunService {
530
557
  if (!executionEvent.ok)
531
558
  return { ok: false, error: executionEvent.error };
532
559
  const linkedAttempt = this.runs.attachAttemptResultEvent(attempt.value.id, executionEvent.value.id);
533
- const evidence = appendApplyProgressAllowlistEvidenceIfNeeded(this.runs, approval.value.id, permissionEvent, pendingExecutionEvent, linkedAttempt.ok ? linkedAttempt.value : attempt.value, executionEvent.value, replayGuard.operationFingerprint, input.executor.name, operation, output, undefined);
560
+ const evidence = appendApplyProgressAllowlistEvidenceIfNeeded(this.runs, approval.value.id, permissionEvent, pendingExecutionEvent, linkedAttempt.ok ? linkedAttempt.value : attempt.value, executionEvent.value, replayGuard.operationFingerprint, input.executor.name, operation, result);
534
561
  if (!evidence.ok)
535
562
  return { ok: false, error: evidence.error };
536
563
  return {
@@ -542,7 +569,7 @@ export class RunService {
542
569
  attempt: linkedAttempt.ok ? linkedAttempt.value : attempt.value,
543
570
  executionEvent: executionEvent.value,
544
571
  status: 'succeeded',
545
- ...(output === undefined ? {} : { output }),
572
+ output: result,
546
573
  ...(evidence.value === undefined ? {} : evidence.value),
547
574
  },
548
575
  };
@@ -1002,24 +1029,21 @@ function workflowConflictDecision(input, runWorkflow) {
1002
1029
  auditEvidence: [`runWorkflow:${runWorkflow}`, `explicitWorkflow:${input.workflow}`],
1003
1030
  };
1004
1031
  }
1005
- function appendApplyProgressAllowlistEvidenceIfNeeded(runs, approvalId, permissionEvent, pendingExecutionEvent, attempt, executionEvent, operationFingerprint, executorName, operation, output, error) {
1032
+ function appendApplyProgressAllowlistEvidenceIfNeeded(runs, approvalId, permissionEvent, pendingExecutionEvent, attempt, executionEvent, operationFingerprint, executorName, operation, result) {
1006
1033
  if (!isApplyProgressAllowlistedCommandOperation(operation))
1007
1034
  return { ok: true, value: undefined };
1008
1035
  const base = {
1009
- kind: 'apply-progress-operation',
1010
- operationKind: 'allowlisted-command',
1011
- runId: attempt.runId,
1012
- approvalId,
1013
- attemptId: attempt.id,
1014
- pendingExecutionEventId: pendingExecutionEvent.id,
1015
- permissionEventId: permissionEvent.id,
1036
+ ...result,
1016
1037
  executionEventId: executionEvent.id,
1017
- operationFingerprint,
1018
- executor: executorName,
1019
- operation: operationMetadata(operation),
1020
- status: attempt.status,
1021
- output: output ?? null,
1022
- error: error ?? null,
1038
+ audit: {
1039
+ metadataOnly: true,
1040
+ operationFingerprint,
1041
+ executor: executorName,
1042
+ approvalId,
1043
+ pendingExecutionEventId: pendingExecutionEvent.id,
1044
+ permissionEventId: permissionEvent.id,
1045
+ attemptId: attempt.id,
1046
+ },
1023
1047
  };
1024
1048
  const evidence = runs.appendEvent({
1025
1049
  runId: attempt.runId,
@@ -162,6 +162,11 @@ function acceptedEvidence(workspaceRoot, cwd, checks) {
162
162
  enforceable: true,
163
163
  createsSandbox: false,
164
164
  createsWorktree: false,
165
+ filesystemIsolation: false,
166
+ networkIsolation: false,
167
+ shellDisabled: true,
168
+ argvArrayOnly: true,
169
+ providerConfigWritesBlocked: true,
165
170
  workspaceRoot,
166
171
  cwd,
167
172
  capabilities: {
@@ -55,16 +55,31 @@ export class CommandAllowlistAdapter {
55
55
  const result = this.runner(this.request);
56
56
  if (!result.ok)
57
57
  throw new Error(`${result.error.code}: ${result.error.message}`);
58
+ const stdoutBytes = Buffer.byteLength(result.value.stdout);
59
+ const stderrBytes = Buffer.byteLength(result.value.stderr);
60
+ const safety = {
61
+ strategy: result.value.evidence.strategy,
62
+ boundedProcess: true,
63
+ createsSandbox: result.value.evidence.createsSandbox,
64
+ createsWorktree: result.value.evidence.createsWorktree,
65
+ filesystemIsolation: result.value.evidence.filesystemIsolation,
66
+ networkIsolation: result.value.evidence.networkIsolation,
67
+ shellDisabled: result.value.evidence.shellDisabled,
68
+ argvArrayOnly: result.value.evidence.argvArrayOnly,
69
+ providerConfigWritesBlocked: result.value.evidence.providerConfigWritesBlocked,
70
+ };
58
71
  const output = {
59
- command: this.commandId,
72
+ commandId: this.commandId,
60
73
  executable: this.entry.executable,
61
- args: this.entry.args,
74
+ argv: [this.entry.executable, ...this.entry.args],
75
+ cwd: this.plan.request.cwd,
62
76
  exitCode: result.value.exitCode,
63
77
  signal: result.value.signal,
64
78
  timedOut: result.value.timedOut,
65
79
  outputTruncated: result.value.outputTruncated,
66
- stdout: result.value.stdout,
67
- stderr: result.value.stderr,
80
+ stdoutBytes,
81
+ stderrBytes,
82
+ safety,
68
83
  };
69
84
  const failed = result.value.timedOut || result.value.exitCode !== 0;
70
85
  return {
@@ -77,6 +92,11 @@ export class CommandAllowlistAdapter {
77
92
  shell: false,
78
93
  argv: [this.entry.executable, ...this.entry.args],
79
94
  cwd: this.plan.request.cwd,
95
+ stdoutBytes,
96
+ stderrBytes,
97
+ outputTruncated: result.value.outputTruncated,
98
+ timedOut: result.value.timedOut,
99
+ safety,
80
100
  },
81
101
  ...(failed
82
102
  ? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vgxness",
3
- "version": "1.19.4",
3
+ "version": "1.19.6",
4
4
  "description": "CLI and MCP control plane for guided AI-agent workflows, SDD, memory, and OpenCode setup.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {