@workflow-cannon/workspace-kit 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -4
- package/dist/cli/run-command.js +7 -2
- package/dist/cli.js +1 -1
- package/dist/core/config-cli.js +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/policy.d.ts +2 -0
- package/dist/core/policy.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,10 +61,12 @@ This keeps automation adaptive without sacrificing safety, governance, or develo
|
|
|
61
61
|
|
|
62
62
|
## Current Status
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- **
|
|
67
|
-
- **Phase
|
|
64
|
+
**Release and phase truth:** see `docs/maintainers/ROADMAP.md` and `docs/maintainers/data/workspace-kit-status.yaml`. **Task queue:** `.workspace-kit/tasks/state.json` (ids and `status` are authoritative for execution).
|
|
65
|
+
|
|
66
|
+
- **Phases 0–7** are complete through **`v0.9.0`** (see roadmap for slice ids).
|
|
67
|
+
- **Phase 8** ships maintainer/onboarding hardening (`v0.10.0`): policy denial clarity, runbooks, and doc alignment for CLI vs `run` approval.
|
|
68
|
+
|
|
69
|
+
Historical note: this file’s milestone list is not the live queue—always check task state for **`ready`** work.
|
|
68
70
|
|
|
69
71
|
## Goals
|
|
70
72
|
|
|
@@ -82,6 +84,18 @@ Install:
|
|
|
82
84
|
npm install @workflow-cannon/workspace-kit
|
|
83
85
|
```
|
|
84
86
|
|
|
87
|
+
### How to run the CLI (this repo and consumers)
|
|
88
|
+
|
|
89
|
+
There is **no** IDE slash command like `/qt` defined by this package unless your own editor config adds one. Supported entrypoints:
|
|
90
|
+
|
|
91
|
+
| Context | Command |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| **Installed package** | `npx @workflow-cannon/workspace-kit --help` or `pnpm exec workspace-kit --help` when the package is a dependency |
|
|
94
|
+
| **Developing this repo** | `pnpm run build` then `node dist/cli.js --help` or `pnpm exec workspace-kit --help` if linked |
|
|
95
|
+
| **Transcript helpers** | `pnpm run transcript:sync` / `pnpm run transcript:ingest` (see maintainer runbooks) |
|
|
96
|
+
|
|
97
|
+
Mutating commands require policy approval: **`docs/maintainers/POLICY-APPROVAL.md`** (JSON **`policyApproval`** for `workspace-kit run`, env for `config`/`init`/`upgrade`).
|
|
98
|
+
|
|
85
99
|
## Repository Map
|
|
86
100
|
|
|
87
101
|
- `README.md` - project entry point
|
|
@@ -106,6 +120,7 @@ npm install @workflow-cannon/workspace-kit
|
|
|
106
120
|
- Project decisions: `docs/maintainers/DECISIONS.md`
|
|
107
121
|
- Governance policy surface: `docs/maintainers/GOVERNANCE.md`
|
|
108
122
|
- Release process and gates: `docs/maintainers/RELEASING.md`
|
|
123
|
+
- Policy / approval surfaces: `docs/maintainers/POLICY-APPROVAL.md`
|
|
109
124
|
- Canonical changelog: `docs/maintainers/CHANGELOG.md` (`CHANGELOG.md` at repo root is pointer-only)
|
|
110
125
|
- Canonical AI module build guidance: `.ai/module-build.md`
|
|
111
126
|
- Human module build guide: `docs/maintainers/module-build-guide.md`
|
package/dist/cli/run-command.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleRegistry } from "../core/module-registry.js";
|
|
2
2
|
import { ModuleCommandRouter } from "../core/module-command-router.js";
|
|
3
|
-
import { appendPolicyTrace, isSensitiveModuleCommandForEffective, parsePolicyApproval, resolveActorWithFallback, resolvePolicyOperationIdForCommand } from "../core/policy.js";
|
|
3
|
+
import { appendPolicyTrace, isSensitiveModuleCommandForEffective, parsePolicyApproval, POLICY_APPROVAL_HUMAN_DOC, resolveActorWithFallback, resolvePolicyOperationIdForCommand } from "../core/policy.js";
|
|
4
4
|
import { getSessionGrant, recordSessionGrant, resolveSessionId } from "../core/session-policy.js";
|
|
5
5
|
import { applyResponseTemplateApplication } from "../core/response-template-shaping.js";
|
|
6
6
|
import { resolveWorkspaceConfigWithLayers } from "../core/workspace-kit-config.js";
|
|
@@ -97,7 +97,12 @@ export async function handleRunCommand(cwd, args, io, codes) {
|
|
|
97
97
|
writeLine(JSON.stringify({
|
|
98
98
|
ok: false,
|
|
99
99
|
code: "policy-denied",
|
|
100
|
-
|
|
100
|
+
operationId: policyOp ?? null,
|
|
101
|
+
remediationDoc: POLICY_APPROVAL_HUMAN_DOC,
|
|
102
|
+
message: 'Sensitive command requires policyApproval in JSON args (or an existing session grant for this operation). Example: {"policyApproval":{"confirmed":true,"rationale":"why","scope":"session"}}. See remediationDoc for env vs JSON approval surfaces.',
|
|
103
|
+
hint: policyOp != null
|
|
104
|
+
? `Operation ${policyOp} requires explicit approval; WORKSPACE_KIT_POLICY_APPROVAL is not read for workspace-kit run.`
|
|
105
|
+
: "Operation could not be mapped to policyOperationId; check policy.extraSensitiveModuleCommands and pass policyApproval in JSON args."
|
|
101
106
|
}, null, 2));
|
|
102
107
|
return codes.validationFailure;
|
|
103
108
|
}
|
package/dist/cli.js
CHANGED
|
@@ -94,7 +94,7 @@ export async function parseJsonFile(filePath) {
|
|
|
94
94
|
async function requireCliPolicyApproval(cwd, operationId, commandLabel, writeError) {
|
|
95
95
|
const approval = parsePolicyApprovalFromEnv(process.env);
|
|
96
96
|
if (!approval) {
|
|
97
|
-
writeError(`workspace-kit ${commandLabel} requires WORKSPACE_KIT_POLICY_APPROVAL with JSON {"confirmed":true,"rationale":"..."} (agent-mediated).`);
|
|
97
|
+
writeError(`workspace-kit ${commandLabel} (${operationId}) requires WORKSPACE_KIT_POLICY_APPROVAL with JSON {"confirmed":true,"rationale":"..."} (agent-mediated). For workspace-kit run sensitive commands, use policyApproval in JSON args instead — see docs/maintainers/POLICY-APPROVAL.md.`);
|
|
98
98
|
await appendPolicyTrace(cwd, {
|
|
99
99
|
timestamp: new Date().toISOString(),
|
|
100
100
|
operationId,
|
package/dist/core/config-cli.js
CHANGED
|
@@ -109,7 +109,7 @@ function parseConfigArgs(argv) {
|
|
|
109
109
|
async function requireConfigApproval(cwd, commandLabel, writeError) {
|
|
110
110
|
const approval = parsePolicyApprovalFromEnv(process.env);
|
|
111
111
|
if (!approval) {
|
|
112
|
-
writeError(`${commandLabel} requires WORKSPACE_KIT_POLICY_APPROVAL with JSON {"confirmed":true,"rationale":"..."}.`);
|
|
112
|
+
writeError(`${commandLabel} (cli.config-mutate) requires WORKSPACE_KIT_POLICY_APPROVAL with JSON {"confirmed":true,"rationale":"..."}. See docs/maintainers/POLICY-APPROVAL.md.`);
|
|
113
113
|
await appendPolicyTrace(cwd, {
|
|
114
114
|
timestamp: new Date().toISOString(),
|
|
115
115
|
operationId: "cli.config-mutate",
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ModuleRegistry, ModuleRegistryError, validateModuleSet, type ModuleRegistryOptions } from "./module-registry.js";
|
|
2
2
|
export { ModuleCommandRouter, ModuleCommandRouterError, type ModuleCommandDescriptor, type ModuleCommandRouterOptions } from "./module-command-router.js";
|
|
3
3
|
export { buildBaseConfigLayers, deepMerge, envToConfigOverlay, explainConfigPath, getAtPath, getProjectConfigPath, getUserConfigFilePath, KIT_CONFIG_DEFAULTS, loadUserLayer, mergeConfigLayers, MODULE_CONFIG_CONTRIBUTIONS, normalizeConfigForExport, PROJECT_CONFIG_REL, resolveWorkspaceConfigWithLayers, stableStringifyConfig, type ConfigLayer, type ConfigLayerId, type EffectiveWorkspaceConfig, type ExplainConfigResult, type ResolveWorkspaceConfigOptions } from "./workspace-kit-config.js";
|
|
4
|
-
export { appendPolicyTrace, getExtraSensitiveModuleCommandsFromEffective, getOperationIdForCommand, isSensitiveModuleCommand, isSensitiveModuleCommandForEffective, parsePolicyApproval, parsePolicyApprovalFromEnv, POLICY_TRACE_SCHEMA_VERSION, resolveActor, resolvePolicyOperationIdForCommand, type PolicyOperationId, type PolicyTraceRecord, type PolicyTraceRecordInput } from "./policy.js";
|
|
4
|
+
export { appendPolicyTrace, getExtraSensitiveModuleCommandsFromEffective, getOperationIdForCommand, isSensitiveModuleCommand, isSensitiveModuleCommandForEffective, parsePolicyApproval, parsePolicyApprovalFromEnv, POLICY_APPROVAL_HUMAN_DOC, POLICY_TRACE_SCHEMA_VERSION, resolveActor, resolvePolicyOperationIdForCommand, type PolicyOperationId, type PolicyTraceRecord, type PolicyTraceRecordInput } from "./policy.js";
|
|
5
5
|
export { getSessionGrant, loadSessionPolicyDocument, recordSessionGrant, resolveSessionId, SESSION_POLICY_SCHEMA_VERSION, type SessionPolicyDocument, type SessionPolicyGrant } from "./session-policy.js";
|
|
6
6
|
export { parseTemplateDirectiveFromText } from "./instruction-template-mapper.js";
|
|
7
7
|
export { RESPONSE_TEMPLATE_CONTRACT_VERSION, MAX_TEMPLATE_WARNING_LENGTH, truncateTemplateWarning, type ResponseTemplateDefinition, type ResponseTemplateEnforcementMode } from "./response-template-contract.js";
|
package/dist/core/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ModuleRegistry, ModuleRegistryError, validateModuleSet } from "./module-registry.js";
|
|
2
2
|
export { ModuleCommandRouter, ModuleCommandRouterError } from "./module-command-router.js";
|
|
3
3
|
export { buildBaseConfigLayers, deepMerge, envToConfigOverlay, explainConfigPath, getAtPath, getProjectConfigPath, getUserConfigFilePath, KIT_CONFIG_DEFAULTS, loadUserLayer, mergeConfigLayers, MODULE_CONFIG_CONTRIBUTIONS, normalizeConfigForExport, PROJECT_CONFIG_REL, resolveWorkspaceConfigWithLayers, stableStringifyConfig } from "./workspace-kit-config.js";
|
|
4
|
-
export { appendPolicyTrace, getExtraSensitiveModuleCommandsFromEffective, getOperationIdForCommand, isSensitiveModuleCommand, isSensitiveModuleCommandForEffective, parsePolicyApproval, parsePolicyApprovalFromEnv, POLICY_TRACE_SCHEMA_VERSION, resolveActor, resolvePolicyOperationIdForCommand } from "./policy.js";
|
|
4
|
+
export { appendPolicyTrace, getExtraSensitiveModuleCommandsFromEffective, getOperationIdForCommand, isSensitiveModuleCommand, isSensitiveModuleCommandForEffective, parsePolicyApproval, parsePolicyApprovalFromEnv, POLICY_APPROVAL_HUMAN_DOC, POLICY_TRACE_SCHEMA_VERSION, resolveActor, resolvePolicyOperationIdForCommand } from "./policy.js";
|
|
5
5
|
export { getSessionGrant, loadSessionPolicyDocument, recordSessionGrant, resolveSessionId, SESSION_POLICY_SCHEMA_VERSION } from "./session-policy.js";
|
|
6
6
|
export { parseTemplateDirectiveFromText } from "./instruction-template-mapper.js";
|
|
7
7
|
export { RESPONSE_TEMPLATE_CONTRACT_VERSION, MAX_TEMPLATE_WARNING_LENGTH, truncateTemplateWarning } from "./response-template-contract.js";
|
package/dist/core/policy.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const POLICY_TRACE_SCHEMA_VERSION: 1;
|
|
2
|
+
/** Maintainer doc (repo-relative) linked from policy denial output for `workspace-kit run`. */
|
|
3
|
+
export declare const POLICY_APPROVAL_HUMAN_DOC = "docs/maintainers/POLICY-APPROVAL.md";
|
|
2
4
|
export type PolicyOperationId = "cli.upgrade" | "cli.init" | "cli.config-mutate" | "policy.dynamic-sensitive" | "doc.document-project" | "doc.generate-document" | "tasks.run-transition" | "approvals.review-item" | "improvement.generate-recommendations" | "improvement.ingest-transcripts";
|
|
3
5
|
export declare function getOperationIdForCommand(commandName: string): PolicyOperationId | undefined;
|
|
4
6
|
export declare function getExtraSensitiveModuleCommandsFromEffective(effective: Record<string, unknown>): string[];
|
package/dist/core/policy.js
CHANGED
|
@@ -2,6 +2,8 @@ import fs from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { execFile } from "node:child_process";
|
|
4
4
|
export const POLICY_TRACE_SCHEMA_VERSION = 1;
|
|
5
|
+
/** Maintainer doc (repo-relative) linked from policy denial output for `workspace-kit run`. */
|
|
6
|
+
export const POLICY_APPROVAL_HUMAN_DOC = "docs/maintainers/POLICY-APPROVAL.md";
|
|
5
7
|
const COMMAND_TO_OPERATION = {
|
|
6
8
|
"document-project": "doc.document-project",
|
|
7
9
|
"generate-document": "doc.generate-document",
|