devworkspace 0.5.0 → 0.5.2
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.
- package/CHANGELOG.md +44 -0
- package/README.md +57 -509
- package/dist/agents/claude/adapter.js +0 -1
- package/dist/agents/claude/content.js +0 -1
- package/dist/agents/codex/adapter.js +0 -1
- package/dist/agents/copilot/adapter.js +0 -1
- package/dist/agents/cursor/adapter.js +0 -1
- package/dist/agents/index.js +0 -1
- package/dist/agents/shared.js +0 -1
- package/dist/agents/types.js +0 -1
- package/dist/cli/args.d.ts +16 -0
- package/dist/cli/args.js +5 -1
- package/dist/cli/help.js +59 -17
- package/dist/cli/main.js +0 -1
- package/dist/cli/prompt.d.ts +15 -0
- package/dist/cli/prompt.js +113 -0
- package/dist/cli/render.d.ts +10 -0
- package/dist/cli/render.js +174 -4
- package/dist/cli/run.d.ts +3 -0
- package/dist/cli/run.js +366 -17
- package/dist/config/feature-gate.d.ts +15 -0
- package/dist/config/feature-gate.js +77 -0
- package/dist/config/feature-registry.d.ts +49 -0
- package/dist/config/feature-registry.js +451 -0
- package/dist/config/schemas.js +0 -1
- package/dist/config/settings.d.ts +54 -0
- package/dist/config/settings.js +293 -0
- package/dist/config/validate.js +0 -1
- package/dist/core/artifacts.js +0 -1
- package/dist/core/contracts.js +0 -1
- package/dist/core/migrations.js +0 -1
- package/dist/core/version.js +0 -1
- package/dist/core/versioned.js +0 -1
- package/dist/core/workspace.d.ts +1 -0
- package/dist/core/workspace.js +1 -1
- package/dist/decisions/decision.js +0 -1
- package/dist/discovery/cache.js +0 -1
- package/dist/discovery/commands.js +0 -1
- package/dist/discovery/detect.js +0 -1
- package/dist/discovery/docs.js +0 -1
- package/dist/discovery/entrypoints.js +0 -1
- package/dist/discovery/ignore.js +0 -1
- package/dist/discovery/scan.js +0 -1
- package/dist/discovery/types.js +0 -1
- package/dist/dx/dashboard.js +2 -1
- package/dist/dx/guidance.js +0 -1
- package/dist/dx/guided-setup.d.ts +102 -0
- package/dist/dx/guided-setup.js +508 -0
- package/dist/dx/index.js +0 -1
- package/dist/dx/onboarding.js +0 -1
- package/dist/dx/types.js +0 -1
- package/dist/errors/index.js +0 -1
- package/dist/features/schema.js +0 -1
- package/dist/features/types.js +0 -1
- package/dist/features/validate.js +0 -1
- package/dist/git/git.js +0 -1
- package/dist/index.d.ts +15 -5
- package/dist/index.js +10 -2
- package/dist/integrations/adapters/agent-skills.js +0 -1
- package/dist/integrations/adapters/claudePlugin.js +0 -1
- package/dist/integrations/adapters/graphify.js +0 -1
- package/dist/integrations/adapters/omniroute.js +0 -1
- package/dist/integrations/adapters/pluginSkill.js +0 -1
- package/dist/integrations/adapters/ponytail.js +0 -1
- package/dist/integrations/exec.js +0 -1
- package/dist/integrations/index.js +0 -1
- package/dist/integrations/manager.d.ts +2 -1
- package/dist/integrations/manager.js +22 -3
- package/dist/integrations/notices.js +0 -1
- package/dist/integrations/persistentPath.js +0 -1
- package/dist/integrations/protect.js +0 -1
- package/dist/integrations/state.js +0 -1
- package/dist/integrations/types.d.ts +1 -1
- package/dist/integrations/types.js +1 -1
- package/dist/intelligence/agents/profiles.js +0 -1
- package/dist/intelligence/agents/registry.js +0 -1
- package/dist/intelligence/agents/types.js +0 -1
- package/dist/intelligence/observability/tracer.js +0 -1
- package/dist/intelligence/observability/types.js +0 -1
- package/dist/intelligence/orchestration/engine.d.ts +21 -3
- package/dist/intelligence/orchestration/engine.js +486 -48
- package/dist/intelligence/orchestration/lock-manager.js +0 -1
- package/dist/intelligence/orchestration/store.js +0 -1
- package/dist/intelligence/orchestration/types.d.ts +40 -2
- package/dist/intelligence/orchestration/types.js +2 -3
- package/dist/intelligence/routing/matcher.js +0 -1
- package/dist/intelligence/routing/router.js +0 -1
- package/dist/intelligence/routing/types.js +0 -1
- package/dist/intelligence/runtime/adk/adapter.js +21 -33
- package/dist/intelligence/runtime/adk/detector.js +0 -1
- package/dist/intelligence/runtime/auth-provider.d.ts +63 -0
- package/dist/intelligence/runtime/auth-provider.js +201 -0
- package/dist/intelligence/runtime/boundary.d.ts +142 -0
- package/dist/intelligence/runtime/boundary.js +845 -0
- package/dist/intelligence/runtime/changes.d.ts +59 -0
- package/dist/intelligence/runtime/changes.js +362 -0
- package/dist/intelligence/runtime/external.d.ts +1 -0
- package/dist/intelligence/runtime/external.js +38 -61
- package/dist/intelligence/runtime/native.js +23 -56
- package/dist/intelligence/runtime/types.d.ts +91 -1
- package/dist/intelligence/runtime/types.js +11 -2
- package/dist/intelligence/security/audit.js +8 -2
- package/dist/intelligence/security/policy.js +0 -1
- package/dist/intelligence/security/types.d.ts +8 -0
- package/dist/intelligence/security/types.js +0 -1
- package/dist/intelligence/skills/builtins.js +0 -1
- package/dist/intelligence/skills/loader.js +0 -1
- package/dist/intelligence/skills/registry.js +0 -1
- package/dist/intelligence/skills/types.js +0 -1
- package/dist/intelligence/verification/engine.d.ts +30 -8
- package/dist/intelligence/verification/engine.js +126 -21
- package/dist/intelligence/verification/reviewer.d.ts +18 -2
- package/dist/intelligence/verification/reviewer.js +356 -4
- package/dist/intelligence/verification/types.d.ts +71 -0
- package/dist/intelligence/verification/types.js +0 -1
- package/dist/knowledge/facts.js +0 -1
- package/dist/mcp/protocol.js +0 -1
- package/dist/mcp/server.js +38 -2
- package/dist/mcp/setup.js +5 -2
- package/dist/mcp/tools.js +0 -1
- package/dist/mcp/types.js +0 -1
- package/dist/mcp/verify.js +0 -1
- package/dist/portability/bundle.js +0 -1
- package/dist/prompts/onboarding.js +0 -1
- package/dist/prompts/refresh.js +0 -1
- package/dist/prompts/requirements.js +0 -1
- package/dist/security/files.js +0 -1
- package/dist/security/redact.js +0 -1
- package/dist/services/agent.js +2 -1
- package/dist/services/analysis.js +0 -1
- package/dist/services/common.js +0 -1
- package/dist/services/doctor.js +13 -2
- package/dist/services/drift.js +0 -1
- package/dist/services/features.js +5 -1
- package/dist/services/graph.js +4 -1
- package/dist/services/init.js +0 -1
- package/dist/services/integrations.d.ts +2 -1
- package/dist/services/integrations.js +29 -6
- package/dist/services/intelligence.d.ts +2 -2
- package/dist/services/intelligence.js +38 -36
- package/dist/services/knowledge.js +0 -1
- package/dist/services/migrate.js +0 -1
- package/dist/services/modules.d.ts +85 -0
- package/dist/services/modules.js +313 -0
- package/dist/services/portability.js +0 -1
- package/dist/services/records.js +5 -1
- package/dist/services/refresh.js +0 -1
- package/dist/services/reset.js +0 -1
- package/dist/services/settings.d.ts +36 -0
- package/dist/services/settings.js +102 -0
- package/dist/services/setup.d.ts +4 -5
- package/dist/services/setup.js +40 -28
- package/dist/services/standards.js +10 -1
- package/dist/services/status.js +0 -1
- package/dist/services/taskContext.js +0 -1
- package/dist/services/tasks.js +9 -1
- package/dist/services/verify.js +7 -2
- package/dist/sessions/session.js +0 -1
- package/dist/standards/acquisition/ingest.js +0 -1
- package/dist/standards/applicability/engine.js +0 -1
- package/dist/standards/builtin/code-quality.js +0 -1
- package/dist/standards/builtin/database-safety.js +0 -1
- package/dist/standards/builtin/index.js +0 -1
- package/dist/standards/builtin/security-baseline.js +0 -1
- package/dist/standards/builtin/testing-contracts.js +0 -1
- package/dist/standards/builtin/undo-kit.js +0 -1
- package/dist/standards/config/config.js +0 -1
- package/dist/standards/distribution/cache.d.ts +1 -0
- package/dist/standards/distribution/cache.js +199 -186
- package/dist/standards/distribution/index.js +0 -1
- package/dist/standards/distribution/keys.js +0 -1
- package/dist/standards/distribution/package.js +6 -1
- package/dist/standards/distribution/server.js +0 -1
- package/dist/standards/distribution/sync.d.ts +7 -2
- package/dist/standards/distribution/sync.js +41 -9
- package/dist/standards/distribution/types.js +0 -1
- package/dist/standards/engine/compliance.js +0 -1
- package/dist/standards/engine/engine.js +0 -1
- package/dist/standards/engine/reporter.js +0 -1
- package/dist/standards/index.js +0 -1
- package/dist/standards/registry/registry.js +0 -1
- package/dist/standards/schema/types.js +0 -1
- package/dist/standards/schema/validate.js +0 -1
- package/dist/standards/templates/index.js +0 -1
- package/dist/standards/validators/database.js +0 -1
- package/dist/standards/validators/quality.js +0 -1
- package/dist/standards/validators/registry.js +0 -1
- package/dist/standards/validators/security.js +0 -1
- package/dist/standards/validators/testing.js +0 -1
- package/dist/standards/validators/types.js +0 -1
- package/dist/standards/validators/undo-kit.js +0 -1
- package/dist/tasks/routing.js +0 -1
- package/dist/tasks/task.js +0 -1
- package/dist/utils/cleanup.js +0 -1
- package/dist/utils/fs.js +0 -1
- package/dist/utils/lock.js +92 -49
- package/dist/utils/logger.js +0 -1
- package/dist/utils/paths.js +0 -1
- package/dist/utils/proc.d.ts +12 -0
- package/dist/utils/proc.js +106 -44
- package/dist/verification/safety.js +0 -1
- package/dist/verification/scope.js +0 -1
- package/docs/agents.md +15 -0
- package/docs/architecture/global-standards-architecture.md +287 -0
- package/docs/archive/global-standards/GLOBAL_STANDARDS_AUDIT.md +99 -0
- package/docs/archive/global-standards/GLOBAL_STANDARDS_FINAL_STATUS.md +138 -0
- package/docs/archive/global-standards/GLOBAL_STANDARDS_IMPLEMENTATION_PLAN.md +100 -0
- package/docs/archive/global-standards/GLOBAL_STANDARDS_INDEPENDENT_AUDIT.md +219 -0
- package/docs/archive/global-standards/GLOBAL_STANDARDS_SECURITY_REPORT.md +184 -0
- package/docs/configuration.md +67 -0
- package/docs/contributing.md +15 -5
- package/docs/development/EXECUTION_STATE.md +50 -0
- package/docs/features.md +80 -0
- package/docs/getting-started.md +69 -111
- package/docs/guides/global-standards-migration.md +100 -0
- package/docs/integrations.md +7 -0
- package/docs/mcp.md +13 -0
- package/docs/security/THIRD_PARTY_LICENSES.md +41 -0
- package/docs/security.md +8 -2
- package/docs/testing/FINAL_CORRECTION_AND_CLEANUP_REPORT.md +92 -0
- package/docs/testing/global-standards-real-project-tests.md +218 -0
- package/docs/testing/global-standards-test-report.md +89 -0
- package/docs/testing/global-standards-verification-matrix.md +174 -0
- package/docs/troubleshooting.md +3 -0
- package/package.json +1 -1
- package/dist/agents/claude/adapter.js.map +0 -1
- package/dist/agents/claude/content.js.map +0 -1
- package/dist/agents/codex/adapter.js.map +0 -1
- package/dist/agents/copilot/adapter.js.map +0 -1
- package/dist/agents/cursor/adapter.js.map +0 -1
- package/dist/agents/index.js.map +0 -1
- package/dist/agents/shared.js.map +0 -1
- package/dist/agents/types.js.map +0 -1
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/main.js.map +0 -1
- package/dist/cli/render.js.map +0 -1
- package/dist/cli/run.js.map +0 -1
- package/dist/config/schemas.js.map +0 -1
- package/dist/config/validate.js.map +0 -1
- package/dist/core/artifacts.js.map +0 -1
- package/dist/core/contracts.js.map +0 -1
- package/dist/core/migrations.js.map +0 -1
- package/dist/core/version.js.map +0 -1
- package/dist/core/versioned.js.map +0 -1
- package/dist/core/workspace.js.map +0 -1
- package/dist/decisions/decision.js.map +0 -1
- package/dist/discovery/cache.js.map +0 -1
- package/dist/discovery/commands.js.map +0 -1
- package/dist/discovery/detect.js.map +0 -1
- package/dist/discovery/docs.js.map +0 -1
- package/dist/discovery/entrypoints.js.map +0 -1
- package/dist/discovery/ignore.js.map +0 -1
- package/dist/discovery/scan.js.map +0 -1
- package/dist/discovery/types.js.map +0 -1
- package/dist/dx/dashboard.js.map +0 -1
- package/dist/dx/guidance.js.map +0 -1
- package/dist/dx/index.js.map +0 -1
- package/dist/dx/onboarding.js.map +0 -1
- package/dist/dx/types.js.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/features/schema.js.map +0 -1
- package/dist/features/types.js.map +0 -1
- package/dist/features/validate.js.map +0 -1
- package/dist/git/git.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/integrations/adapters/agent-skills.js.map +0 -1
- package/dist/integrations/adapters/claudePlugin.js.map +0 -1
- package/dist/integrations/adapters/graphify.js.map +0 -1
- package/dist/integrations/adapters/omniroute.js.map +0 -1
- package/dist/integrations/adapters/pluginSkill.js.map +0 -1
- package/dist/integrations/adapters/ponytail.js.map +0 -1
- package/dist/integrations/exec.js.map +0 -1
- package/dist/integrations/index.js.map +0 -1
- package/dist/integrations/manager.js.map +0 -1
- package/dist/integrations/notices.js.map +0 -1
- package/dist/integrations/persistentPath.js.map +0 -1
- package/dist/integrations/protect.js.map +0 -1
- package/dist/integrations/state.js.map +0 -1
- package/dist/integrations/types.js.map +0 -1
- package/dist/intelligence/agents/profiles.js.map +0 -1
- package/dist/intelligence/agents/registry.js.map +0 -1
- package/dist/intelligence/agents/types.js.map +0 -1
- package/dist/intelligence/observability/tracer.js.map +0 -1
- package/dist/intelligence/observability/types.js.map +0 -1
- package/dist/intelligence/orchestration/engine.js.map +0 -1
- package/dist/intelligence/orchestration/lock-manager.js.map +0 -1
- package/dist/intelligence/orchestration/store.js.map +0 -1
- package/dist/intelligence/orchestration/types.js.map +0 -1
- package/dist/intelligence/routing/matcher.js.map +0 -1
- package/dist/intelligence/routing/router.js.map +0 -1
- package/dist/intelligence/routing/types.js.map +0 -1
- package/dist/intelligence/runtime/adk/adapter.js.map +0 -1
- package/dist/intelligence/runtime/adk/detector.js.map +0 -1
- package/dist/intelligence/runtime/external.js.map +0 -1
- package/dist/intelligence/runtime/native.js.map +0 -1
- package/dist/intelligence/runtime/types.js.map +0 -1
- package/dist/intelligence/security/audit.js.map +0 -1
- package/dist/intelligence/security/policy.js.map +0 -1
- package/dist/intelligence/security/types.js.map +0 -1
- package/dist/intelligence/skills/builtins.js.map +0 -1
- package/dist/intelligence/skills/loader.js.map +0 -1
- package/dist/intelligence/skills/registry.js.map +0 -1
- package/dist/intelligence/skills/types.js.map +0 -1
- package/dist/intelligence/verification/engine.js.map +0 -1
- package/dist/intelligence/verification/reviewer.js.map +0 -1
- package/dist/intelligence/verification/types.js.map +0 -1
- package/dist/knowledge/facts.js.map +0 -1
- package/dist/mcp/protocol.js.map +0 -1
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/setup.js.map +0 -1
- package/dist/mcp/tools.js.map +0 -1
- package/dist/mcp/types.js.map +0 -1
- package/dist/mcp/verify.js.map +0 -1
- package/dist/portability/bundle.js.map +0 -1
- package/dist/prompts/onboarding.js.map +0 -1
- package/dist/prompts/refresh.js.map +0 -1
- package/dist/prompts/requirements.js.map +0 -1
- package/dist/security/files.js.map +0 -1
- package/dist/security/redact.js.map +0 -1
- package/dist/services/agent.js.map +0 -1
- package/dist/services/analysis.js.map +0 -1
- package/dist/services/common.js.map +0 -1
- package/dist/services/doctor.js.map +0 -1
- package/dist/services/drift.js.map +0 -1
- package/dist/services/features.js.map +0 -1
- package/dist/services/graph.js.map +0 -1
- package/dist/services/init.js.map +0 -1
- package/dist/services/integrations.js.map +0 -1
- package/dist/services/intelligence.js.map +0 -1
- package/dist/services/knowledge.js.map +0 -1
- package/dist/services/migrate.js.map +0 -1
- package/dist/services/portability.js.map +0 -1
- package/dist/services/records.js.map +0 -1
- package/dist/services/refresh.js.map +0 -1
- package/dist/services/reset.js.map +0 -1
- package/dist/services/setup.js.map +0 -1
- package/dist/services/standards.js.map +0 -1
- package/dist/services/status.js.map +0 -1
- package/dist/services/taskContext.js.map +0 -1
- package/dist/services/tasks.js.map +0 -1
- package/dist/services/verify.js.map +0 -1
- package/dist/sessions/session.js.map +0 -1
- package/dist/standards/acquisition/ingest.js.map +0 -1
- package/dist/standards/applicability/engine.js.map +0 -1
- package/dist/standards/builtin/code-quality.js.map +0 -1
- package/dist/standards/builtin/database-safety.js.map +0 -1
- package/dist/standards/builtin/index.js.map +0 -1
- package/dist/standards/builtin/security-baseline.js.map +0 -1
- package/dist/standards/builtin/testing-contracts.js.map +0 -1
- package/dist/standards/builtin/undo-kit.js.map +0 -1
- package/dist/standards/config/config.js.map +0 -1
- package/dist/standards/distribution/cache.js.map +0 -1
- package/dist/standards/distribution/index.js.map +0 -1
- package/dist/standards/distribution/keys.js.map +0 -1
- package/dist/standards/distribution/package.js.map +0 -1
- package/dist/standards/distribution/server.js.map +0 -1
- package/dist/standards/distribution/sync.js.map +0 -1
- package/dist/standards/distribution/types.js.map +0 -1
- package/dist/standards/engine/compliance.js.map +0 -1
- package/dist/standards/engine/engine.js.map +0 -1
- package/dist/standards/engine/reporter.js.map +0 -1
- package/dist/standards/index.js.map +0 -1
- package/dist/standards/registry/registry.js.map +0 -1
- package/dist/standards/schema/types.js.map +0 -1
- package/dist/standards/schema/validate.js.map +0 -1
- package/dist/standards/templates/index.js.map +0 -1
- package/dist/standards/validators/database.js.map +0 -1
- package/dist/standards/validators/quality.js.map +0 -1
- package/dist/standards/validators/registry.js.map +0 -1
- package/dist/standards/validators/security.js.map +0 -1
- package/dist/standards/validators/testing.js.map +0 -1
- package/dist/standards/validators/types.js.map +0 -1
- package/dist/standards/validators/undo-kit.js.map +0 -1
- package/dist/tasks/routing.js.map +0 -1
- package/dist/tasks/task.js.map +0 -1
- package/dist/utils/cleanup.js.map +0 -1
- package/dist/utils/fs.js.map +0 -1
- package/dist/utils/lock.js.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/proc.js.map +0 -1
- package/dist/verification/safety.js.map +0 -1
- package/dist/verification/scope.js.map +0 -1
|
@@ -1,35 +1,123 @@
|
|
|
1
|
+
import type { WorkspaceChangeManifest } from './changes.js';
|
|
2
|
+
export declare const RUNTIME_EXECUTION_STATUSES: readonly ["PREPARED", "RUNNING", "SUCCEEDED", "FAILED", "BLOCKED", "NOT_EXECUTED", "TIMED_OUT", "CANCELLED", "UNSUPPORTED"];
|
|
3
|
+
export type RuntimeExecutionStatus = (typeof RUNTIME_EXECUTION_STATUSES)[number];
|
|
4
|
+
export type ExecutionKind = 'command' | 'agent' | 'preparation' | 'none';
|
|
5
|
+
export type SandboxCapability = 'unavailable-cwd-only';
|
|
6
|
+
export type ApproverAuthMethod = 'cli-local-user' | 'ci-oidc' | 'signed-token' | 'api-key-verified' | 'service-account';
|
|
7
|
+
export interface ApproverIdentity {
|
|
8
|
+
principalId: string;
|
|
9
|
+
authMethod: ApproverAuthMethod;
|
|
10
|
+
authenticatedAt: string;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
issuer?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ApproverCredentials {
|
|
15
|
+
principalId: string;
|
|
16
|
+
token: string;
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AuthenticatedApproverSession {
|
|
20
|
+
principalId: string;
|
|
21
|
+
authMethod: ApproverAuthMethod;
|
|
22
|
+
authenticatedAt: string;
|
|
23
|
+
sessionId: string;
|
|
24
|
+
issuer: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ApprovalGrantProof {
|
|
27
|
+
algorithm: 'hmac-sha256' | 'ed25519';
|
|
28
|
+
keyId: string;
|
|
29
|
+
providerId: string;
|
|
30
|
+
signature: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ApprovalAuthProvider {
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly authMethod: ApproverAuthMethod;
|
|
35
|
+
readonly keyId: string;
|
|
36
|
+
readonly algorithm: 'hmac-sha256' | 'ed25519';
|
|
37
|
+
authenticate(credentials?: ApproverCredentials): Promise<AuthenticatedApproverSession>;
|
|
38
|
+
signGrant?(canonicalPayload: string): Promise<ApprovalGrantProof>;
|
|
39
|
+
verifyGrant(canonicalPayload: string, proof: ApprovalGrantProof): Promise<boolean>;
|
|
40
|
+
}
|
|
41
|
+
/** Cryptographically/structurally scoped authorization bound to concrete stage, executable, args, workspace, identity, and TTL. */
|
|
42
|
+
export interface ApprovalGrant {
|
|
43
|
+
grantId: string;
|
|
44
|
+
approvedBy: string;
|
|
45
|
+
approvedAt: string;
|
|
46
|
+
expiresAt: string;
|
|
47
|
+
approverIdentity: ApproverIdentity;
|
|
48
|
+
grantSignature: ApprovalGrantProof;
|
|
49
|
+
revokedAt?: string;
|
|
50
|
+
revokedBy?: string;
|
|
51
|
+
revocationReason?: string;
|
|
52
|
+
operation: 'command-exec' | 'external-agent' | 'destructive-op';
|
|
53
|
+
stageId?: string;
|
|
54
|
+
stageScope?: 'stage-bound' | 'stage-independent';
|
|
55
|
+
executable: string;
|
|
56
|
+
args: string[];
|
|
57
|
+
workspaceRoot: string;
|
|
58
|
+
}
|
|
1
59
|
export interface AgentExecutionRequest {
|
|
2
60
|
agentId: string;
|
|
3
61
|
role: string;
|
|
62
|
+
stageId?: string;
|
|
4
63
|
prompt: string;
|
|
5
64
|
skills?: string[];
|
|
6
|
-
toolPermissions?:
|
|
65
|
+
toolPermissions?: unknown[];
|
|
7
66
|
contextFiles?: string[];
|
|
8
67
|
tools?: string[];
|
|
9
68
|
timeoutMs?: number;
|
|
10
69
|
signal?: AbortSignal;
|
|
11
70
|
command?: string[];
|
|
12
71
|
cwd?: string;
|
|
72
|
+
workspaceRoot?: string;
|
|
13
73
|
env?: Record<string, string>;
|
|
74
|
+
allowlistedEnvKeys?: string[];
|
|
14
75
|
maxBytes?: number;
|
|
15
76
|
allowExternalExecution?: boolean;
|
|
77
|
+
/** Working directory override for external invocation; does not provide OS sandboxing. */
|
|
16
78
|
sandboxPath?: string;
|
|
79
|
+
/** Scoped authorization grants bound to concrete commands, stages, and workspace roots. */
|
|
80
|
+
approvalGrants?: ApprovalGrant[];
|
|
81
|
+
/** Trusted authentication/verification provider used to validate grant signatures before execution. */
|
|
82
|
+
authProvider?: ApprovalAuthProvider;
|
|
83
|
+
/** Explicit policy opt-in allowing stage-independent grants for un-staged invocations (defaults to false). */
|
|
84
|
+
allowStageIndependent?: boolean;
|
|
17
85
|
isDeterministic?: boolean;
|
|
18
86
|
isPlaceholder?: boolean;
|
|
19
87
|
}
|
|
20
88
|
export interface AgentExecutionResponse {
|
|
89
|
+
/** True only when real execution (`SUCCEEDED`) ran; never true for `PREPARED`, `NOT_EXECUTED`, or `UNSUPPORTED`. */
|
|
21
90
|
ok: boolean;
|
|
91
|
+
status: RuntimeExecutionStatus;
|
|
92
|
+
executionKind: ExecutionKind;
|
|
93
|
+
executionId: string;
|
|
94
|
+
/** Verification is always separate from execution and starts as NOT_TESTED until a real verifier runs. */
|
|
95
|
+
verificationStatus: 'NOT_TESTED';
|
|
22
96
|
output: string;
|
|
97
|
+
/** External provider output is untrusted data, never policy. */
|
|
98
|
+
untrustedOutput?: boolean;
|
|
23
99
|
error?: string;
|
|
100
|
+
reason?: string;
|
|
101
|
+
remediation?: string;
|
|
102
|
+
command?: string[];
|
|
103
|
+
cwd?: string;
|
|
104
|
+
startedAt?: string;
|
|
105
|
+
endedAt?: string;
|
|
24
106
|
tokensUsed?: number;
|
|
25
107
|
durationMs: number;
|
|
108
|
+
/** Actual workspace files created, modified, or renamed during execution (never synthetic contextFiles). */
|
|
26
109
|
filesModified: string[];
|
|
110
|
+
/** Complete diff manifest recorded before vs after execution. */
|
|
111
|
+
changeManifest?: WorkspaceChangeManifest;
|
|
27
112
|
exitCode?: number;
|
|
28
113
|
stdout?: string;
|
|
29
114
|
stderr?: string;
|
|
30
115
|
timedOut?: boolean;
|
|
31
116
|
aborted?: boolean;
|
|
32
117
|
isPlaceholder?: boolean;
|
|
118
|
+
/** Explicitly false when only cwd isolation is used without OS sandboxing. */
|
|
119
|
+
sandboxed: boolean;
|
|
120
|
+
sandboxCapability: SandboxCapability;
|
|
33
121
|
evidence?: Record<string, unknown>;
|
|
34
122
|
}
|
|
35
123
|
export interface RuntimeAvailability {
|
|
@@ -39,6 +127,8 @@ export interface RuntimeAvailability {
|
|
|
39
127
|
reason?: string;
|
|
40
128
|
supportsStreaming: boolean;
|
|
41
129
|
supportsNativeSubagents: boolean;
|
|
130
|
+
sandboxed?: boolean;
|
|
131
|
+
sandboxCapability?: SandboxCapability;
|
|
42
132
|
}
|
|
43
133
|
export interface AgentRuntimeAdapter {
|
|
44
134
|
readonly id: string;
|
|
@@ -14,7 +14,14 @@ export class SecurityAuditLogger {
|
|
|
14
14
|
const filePath = this.auditLogPath();
|
|
15
15
|
await ensureDir(path.dirname(filePath));
|
|
16
16
|
const line = JSON.stringify(entry) + '\n';
|
|
17
|
-
await fs.
|
|
17
|
+
const fh = await fs.open(filePath, 'a');
|
|
18
|
+
try {
|
|
19
|
+
await fh.writeFile(line, 'utf8');
|
|
20
|
+
await fh.sync();
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
await fh.close();
|
|
24
|
+
}
|
|
18
25
|
}
|
|
19
26
|
async getRecentEntries(limit = 100) {
|
|
20
27
|
const filePath = this.auditLogPath();
|
|
@@ -40,4 +47,3 @@ export class SecurityAuditLogger {
|
|
|
40
47
|
}
|
|
41
48
|
}
|
|
42
49
|
}
|
|
43
|
-
//# sourceMappingURL=audit.js.map
|
|
@@ -22,4 +22,12 @@ export interface SecurityAuditEntry {
|
|
|
22
22
|
allowed: boolean;
|
|
23
23
|
requiresApproval: boolean;
|
|
24
24
|
reason?: string;
|
|
25
|
+
eventType?: 'command-policy' | 'grant-issued' | 'grant-revoked' | 'grant-validated' | 'grant-rejected';
|
|
26
|
+
grantId?: string;
|
|
27
|
+
approvedBy?: string;
|
|
28
|
+
principalId?: string;
|
|
29
|
+
sessionId?: string;
|
|
30
|
+
authMethod?: string;
|
|
31
|
+
stageId?: string;
|
|
32
|
+
operation?: string;
|
|
25
33
|
}
|
|
@@ -1,23 +1,45 @@
|
|
|
1
|
-
import type { GateCheckType, VerificationEvaluationReport } from './types.js';
|
|
1
|
+
import type { AcceptanceCriterionSpec, CriterionEvidenceMapping, GateCheckType, StructuredTestCaseEvidence, VerificationEvaluationReport } from './types.js';
|
|
2
|
+
import type { WorkspaceChangeManifest } from '../runtime/changes.js';
|
|
2
3
|
export interface ContractCheckCommand {
|
|
3
4
|
id: GateCheckType;
|
|
4
5
|
command: string;
|
|
5
6
|
required: boolean;
|
|
6
7
|
}
|
|
8
|
+
export interface CommandCheckOutput {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
exitCode: number;
|
|
11
|
+
output: string;
|
|
12
|
+
durationMs: number;
|
|
13
|
+
executionId?: string;
|
|
14
|
+
testCases?: StructuredTestCaseEvidence[];
|
|
15
|
+
timedOut?: boolean;
|
|
16
|
+
skipped?: boolean;
|
|
17
|
+
blocked?: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
7
20
|
export interface VerificationEngineOptions {
|
|
8
|
-
runCommandFn: (cmd: string) => Promise<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
runCommandFn: (cmd: string) => Promise<CommandCheckOutput>;
|
|
22
|
+
verifierId?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface VerificationBindingContext {
|
|
25
|
+
executionId?: string;
|
|
26
|
+
stageId?: string;
|
|
27
|
+
workspaceFingerprint?: string;
|
|
28
|
+
evidenceRefs?: string[];
|
|
29
|
+
changeManifest?: WorkspaceChangeManifest;
|
|
30
|
+
criteriaMappings?: CriterionEvidenceMapping[];
|
|
31
|
+
snapshotComplete?: boolean;
|
|
32
|
+
snapshotIncompleteReasons?: string[];
|
|
33
|
+
allowEmptyChanges?: boolean;
|
|
14
34
|
}
|
|
15
35
|
export declare class IndependentVerificationEngine {
|
|
36
|
+
readonly verifierId: string;
|
|
37
|
+
readonly verifierVersion: string;
|
|
16
38
|
private reviewer;
|
|
17
39
|
private runCommandFn;
|
|
18
40
|
constructor(options: VerificationEngineOptions);
|
|
19
41
|
verify(contractChecks: ContractCheckCommand[], modifiedFiles: {
|
|
20
42
|
path: string;
|
|
21
43
|
content: string;
|
|
22
|
-
}[], acceptanceCriteria?: string[], retryCount?: number, maxRetries?: number): Promise<VerificationEvaluationReport>;
|
|
44
|
+
}[], acceptanceCriteria?: (string | AcceptanceCriterionSpec)[], retryCount?: number, maxRetries?: number, binding?: VerificationBindingContext): Promise<VerificationEvaluationReport>;
|
|
23
45
|
}
|
|
@@ -1,42 +1,126 @@
|
|
|
1
1
|
import { IndependentReviewer } from './reviewer.js';
|
|
2
2
|
import { redact } from '../../security/redact.js';
|
|
3
|
+
import { packageVersion } from '../../core/version.js';
|
|
3
4
|
export class IndependentVerificationEngine {
|
|
5
|
+
verifierId;
|
|
6
|
+
verifierVersion;
|
|
4
7
|
reviewer;
|
|
5
8
|
runCommandFn;
|
|
6
9
|
constructor(options) {
|
|
10
|
+
this.verifierId = options.verifierId ?? 'devworkspace-independent-verifier';
|
|
11
|
+
this.verifierVersion = packageVersion();
|
|
7
12
|
this.reviewer = new IndependentReviewer();
|
|
8
13
|
this.runCommandFn = options.runCommandFn;
|
|
9
14
|
}
|
|
10
|
-
async verify(contractChecks, modifiedFiles, acceptanceCriteria = [], retryCount = 0, maxRetries = 3) {
|
|
15
|
+
async verify(contractChecks, modifiedFiles, acceptanceCriteria = [], retryCount = 0, maxRetries = 3, binding = {}) {
|
|
11
16
|
const gates = [];
|
|
12
|
-
|
|
17
|
+
let hardStatus = null;
|
|
18
|
+
const snapshotComplete = (binding.snapshotComplete ?? true) &&
|
|
19
|
+
(binding.changeManifest ? binding.changeManifest.snapshotComplete : true);
|
|
20
|
+
if (!snapshotComplete) {
|
|
21
|
+
hardStatus = 'BLOCKED';
|
|
22
|
+
}
|
|
23
|
+
else if (contractChecks.length === 0) {
|
|
24
|
+
hardStatus = 'NOT_TESTED';
|
|
25
|
+
}
|
|
26
|
+
// 1. Run all configured automated contract checks, failing closed on error/timeout/skip
|
|
13
27
|
for (const check of contractChecks) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
try {
|
|
29
|
+
const res = await this.runCommandFn(check.command);
|
|
30
|
+
let status = 'PASS';
|
|
31
|
+
if (res.timedOut) {
|
|
32
|
+
status = 'TIMED_OUT';
|
|
33
|
+
}
|
|
34
|
+
else if (res.skipped) {
|
|
35
|
+
status = 'SKIPPED';
|
|
36
|
+
}
|
|
37
|
+
else if (res.blocked) {
|
|
38
|
+
status = 'BLOCKED';
|
|
39
|
+
}
|
|
40
|
+
else if (res.error && !res.ok) {
|
|
41
|
+
status = 'ERROR';
|
|
42
|
+
}
|
|
43
|
+
else if (!res.ok) {
|
|
44
|
+
status = 'FAIL';
|
|
45
|
+
}
|
|
46
|
+
const passed = status === 'PASS' && res.ok === true;
|
|
47
|
+
if (!passed && check.required && hardStatus === null) {
|
|
48
|
+
hardStatus = status;
|
|
49
|
+
}
|
|
50
|
+
gates.push({
|
|
51
|
+
check: check.id,
|
|
52
|
+
required: check.required,
|
|
53
|
+
passed,
|
|
54
|
+
status,
|
|
55
|
+
exitCode: res.exitCode,
|
|
56
|
+
executionId: res.executionId ?? binding.executionId,
|
|
57
|
+
testCases: res.testCases,
|
|
58
|
+
output: redact((res.error || res.output).slice(-2000)),
|
|
59
|
+
durationMs: res.durationMs,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
if (check.required && hardStatus === null) {
|
|
64
|
+
hardStatus = 'ERROR';
|
|
65
|
+
}
|
|
66
|
+
gates.push({
|
|
67
|
+
check: check.id,
|
|
68
|
+
required: check.required,
|
|
69
|
+
passed: false,
|
|
70
|
+
status: 'ERROR',
|
|
71
|
+
exitCode: 1,
|
|
72
|
+
output: redact(err.message.slice(0, 500)),
|
|
73
|
+
durationMs: 0,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
23
76
|
}
|
|
24
|
-
|
|
25
|
-
|
|
77
|
+
const executedChecksSnapshot = [...gates];
|
|
78
|
+
// 2. Run independent reviewer check on actual changed files + executed check outputs + explicit criteria mappings
|
|
79
|
+
const review = this.reviewer.reviewModifiedFiles(modifiedFiles, acceptanceCriteria, {
|
|
80
|
+
changeManifest: binding.changeManifest,
|
|
81
|
+
checkResults: executedChecksSnapshot,
|
|
82
|
+
executionId: binding.executionId,
|
|
83
|
+
criteriaMappings: binding.criteriaMappings,
|
|
84
|
+
snapshotComplete,
|
|
85
|
+
snapshotIncompleteReasons: binding.snapshotIncompleteReasons,
|
|
86
|
+
requireChanges: !(binding.allowEmptyChanges ?? false),
|
|
87
|
+
requireFunctionalChecks: true,
|
|
88
|
+
});
|
|
26
89
|
gates.push({
|
|
27
90
|
check: 'review',
|
|
28
91
|
required: true,
|
|
29
92
|
passed: review.passed,
|
|
93
|
+
status: review.passed ? 'PASS' : (!snapshotComplete ? 'BLOCKED' : contractChecks.length === 0 ? 'NOT_TESTED' : 'FAIL'),
|
|
30
94
|
exitCode: review.passed ? 0 : 1,
|
|
31
95
|
output: review.summary,
|
|
32
96
|
durationMs: 5,
|
|
33
97
|
});
|
|
98
|
+
const staticCheckGates = executedChecksSnapshot.filter((g) => g.check === 'lint' || g.check === 'security');
|
|
99
|
+
const staticChecksOk = staticCheckGates.every((g) => !g.required || (g.passed && g.status === 'PASS'));
|
|
100
|
+
const staticHygienePassed = review.staticHygienePassed && staticChecksOk;
|
|
101
|
+
const functionalGates = executedChecksSnapshot.filter((g) => g.check !== 'lint' && g.check !== 'security');
|
|
102
|
+
const functionalVerificationPassed = snapshotComplete &&
|
|
103
|
+
functionalGates.length > 0 &&
|
|
104
|
+
functionalGates.some((g) => g.passed && g.status === 'PASS') &&
|
|
105
|
+
functionalGates.every((g) => !g.required || (g.passed && g.status === 'PASS')) &&
|
|
106
|
+
review.functionalEvidencePassed;
|
|
34
107
|
const mandatoryGates = gates.filter((g) => g.required);
|
|
35
|
-
const mandatoryGatesPassed =
|
|
36
|
-
|
|
108
|
+
const mandatoryGatesPassed = snapshotComplete &&
|
|
109
|
+
contractChecks.length > 0 &&
|
|
110
|
+
staticHygienePassed &&
|
|
111
|
+
functionalVerificationPassed &&
|
|
112
|
+
mandatoryGates.every((g) => g.passed && g.status === 'PASS');
|
|
113
|
+
const allPassed = snapshotComplete &&
|
|
114
|
+
contractChecks.length > 0 &&
|
|
115
|
+
staticHygienePassed &&
|
|
116
|
+
functionalVerificationPassed &&
|
|
117
|
+
gates.every((g) => g.passed && g.status === 'PASS');
|
|
118
|
+
const verificationStatus = mandatoryGatesPassed
|
|
119
|
+
? 'PASS'
|
|
120
|
+
: hardStatus ?? (contractChecks.length === 0 ? 'NOT_TESTED' : 'FAIL');
|
|
37
121
|
let nextAction;
|
|
38
122
|
let canComplete;
|
|
39
|
-
if (mandatoryGatesPassed) {
|
|
123
|
+
if (mandatoryGatesPassed && verificationStatus === 'PASS') {
|
|
40
124
|
nextAction = 'COMPLETE';
|
|
41
125
|
canComplete = true;
|
|
42
126
|
}
|
|
@@ -48,11 +132,33 @@ export class IndependentVerificationEngine {
|
|
|
48
132
|
nextAction = 'FAIL';
|
|
49
133
|
canComplete = false;
|
|
50
134
|
}
|
|
51
|
-
const failedChecks = gates.filter((g) => !g.passed).map((g) => g.check).join(', ');
|
|
52
|
-
const summary =
|
|
53
|
-
? 'All mandatory verification gates passed.'
|
|
54
|
-
: `Verification failed (${failedChecks}). ${nextAction === 'CORRECT' ? `Entering correction attempt ${retryCount + 1}/${maxRetries}.` : 'Max correction retries exhausted.'}`;
|
|
135
|
+
const failedChecks = gates.filter((g) => !g.passed).map((g) => `${g.check}:${g.status}`).join(', ');
|
|
136
|
+
const summary = canComplete
|
|
137
|
+
? 'All mandatory verification gates passed (static hygiene + functional verification).'
|
|
138
|
+
: `Verification failed (${failedChecks || verificationStatus}). ${nextAction === 'CORRECT' ? `Entering correction attempt ${retryCount + 1}/${maxRetries}.` : 'Max correction retries exhausted.'}`;
|
|
139
|
+
const checksPerformed = gates.map((g) => `${g.check}:${g.status}`);
|
|
140
|
+
const manifestRefs = binding.changeManifest
|
|
141
|
+
? binding.changeManifest.changedFiles
|
|
142
|
+
: [];
|
|
143
|
+
const evidenceRefs = [
|
|
144
|
+
...modifiedFiles.map((f) => f.path),
|
|
145
|
+
...manifestRefs,
|
|
146
|
+
...(binding.evidenceRefs ?? []),
|
|
147
|
+
];
|
|
55
148
|
return {
|
|
149
|
+
verificationStatus,
|
|
150
|
+
verifierId: this.verifierId,
|
|
151
|
+
verifierVersion: this.verifierVersion,
|
|
152
|
+
executionId: binding.executionId,
|
|
153
|
+
stageId: binding.stageId,
|
|
154
|
+
workspaceFingerprint: binding.workspaceFingerprint,
|
|
155
|
+
changeManifest: binding.changeManifest,
|
|
156
|
+
snapshotComplete,
|
|
157
|
+
staticHygienePassed,
|
|
158
|
+
functionalVerificationPassed,
|
|
159
|
+
verifiedAt: new Date().toISOString(),
|
|
160
|
+
checksPerformed,
|
|
161
|
+
evidenceRefs: [...new Set(evidenceRefs)],
|
|
56
162
|
allPassed,
|
|
57
163
|
mandatoryGatesPassed,
|
|
58
164
|
gates,
|
|
@@ -63,4 +169,3 @@ export class IndependentVerificationEngine {
|
|
|
63
169
|
};
|
|
64
170
|
}
|
|
65
171
|
}
|
|
66
|
-
//# sourceMappingURL=engine.js.map
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WorkspaceChangeManifest } from '../runtime/changes.js';
|
|
2
|
+
import type { AcceptanceCriterionSpec, CriterionEvidenceMapping, GateResult, IndependentReviewReport } from './types.js';
|
|
3
|
+
export interface ReviewOptions {
|
|
4
|
+
changeManifest?: WorkspaceChangeManifest;
|
|
5
|
+
checkResults?: GateResult[];
|
|
6
|
+
/** Execution identifier binding structured test evidence to the current run. */
|
|
7
|
+
executionId?: string;
|
|
8
|
+
/** Explicit criterion-to-check/test-evidence bindings for string acceptance criteria. */
|
|
9
|
+
criteriaMappings?: CriterionEvidenceMapping[];
|
|
10
|
+
/** Snapshot completeness indicator; incomplete snapshots cannot be verified complete. */
|
|
11
|
+
snapshotComplete?: boolean;
|
|
12
|
+
snapshotIncompleteReasons?: string[];
|
|
13
|
+
/** Default true: reject empty change sets when verifying an implementation claim. */
|
|
14
|
+
requireChanges?: boolean;
|
|
15
|
+
/** Default true when criteria exist or when invoked from IndependentVerificationEngine. */
|
|
16
|
+
requireFunctionalChecks?: boolean;
|
|
17
|
+
}
|
|
2
18
|
export declare class IndependentReviewer {
|
|
3
19
|
private reviewerId;
|
|
4
20
|
reviewModifiedFiles(modifiedFiles: {
|
|
5
21
|
path: string;
|
|
6
22
|
content: string;
|
|
7
|
-
}[],
|
|
23
|
+
}[], criteria?: (string | AcceptanceCriterionSpec)[], options?: ReviewOptions): IndependentReviewReport;
|
|
8
24
|
}
|