prizmkit 1.1.159 → 1.1.160

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 (77) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codebuddy/settings-adapter.js +76 -25
  3. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +9 -2
  4. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +42 -15
  5. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
  6. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +1 -1
  7. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +6 -6
  8. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +4 -3
  9. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +2 -2
  10. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +2 -2
  11. package/bundled/dev-pipeline/tests/test_runtime_commit.py +68 -13
  12. package/bundled/dev-pipeline/tests/test_unified_cli.py +10 -6
  13. package/bundled/rules/prizm/prizm-commit-workflow.md +7 -7
  14. package/bundled/rules/prizm/prizm-documentation.md +24 -65
  15. package/bundled/rules/prizm/prizm-progressive-loading.md +9 -8
  16. package/bundled/skills/_metadata.json +1 -1
  17. package/bundled/skills/prizmkit-code-review/SKILL.md +1 -1
  18. package/bundled/skills/prizmkit-committer/SKILL.md +48 -41
  19. package/bundled/skills/prizmkit-deploy/SKILL.md +172 -198
  20. package/bundled/skills/prizmkit-deploy/references/capability-contract.md +137 -0
  21. package/bundled/skills/prizmkit-deploy/references/deploy-record-schema.json +1053 -0
  22. package/bundled/skills/prizmkit-deploy/references/deployment-declaration-schema.json +291 -0
  23. package/bundled/skills/prizmkit-deploy/references/legacy-migration.md +90 -0
  24. package/bundled/skills/prizmkit-deploy/references/policy-and-execution.md +170 -0
  25. package/bundled/skills/prizmkit-deploy/references/real-resource-test-policy.md +73 -0
  26. package/bundled/skills/prizmkit-deploy/references/verification-and-recovery.md +164 -0
  27. package/bundled/skills/prizmkit-deploy/scripts/validate-deploy-artifact.py +371 -0
  28. package/bundled/skills/prizmkit-implement/SKILL.md +2 -2
  29. package/bundled/skills/prizmkit-init/SKILL.md +17 -17
  30. package/bundled/skills/prizmkit-init/references/update-supplement.md +5 -5
  31. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +17 -11
  32. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +95 -155
  33. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +6 -5
  34. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +4 -2
  35. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +9 -10
  36. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +6 -5
  37. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +13 -12
  38. package/bundled/skills/prizmkit-retrospective/SKILL.md +3 -3
  39. package/bundled/skills/prizmkit-test/SKILL.md +26 -13
  40. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +8 -4
  41. package/bundled/skills/prizmkit-test/references/independent-test-review.md +7 -3
  42. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +33 -10
  43. package/bundled/skills/prizmkit-test/references/test-report-template.md +33 -11
  44. package/bundled/skills/prizmkit-workflow/SKILL.md +5 -7
  45. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +5 -6
  46. package/bundled/templates/hooks/commit-intent-status.py +9 -41
  47. package/bundled/templates/hooks/commit-intent.json +3 -3
  48. package/bundled/templates/hooks/diff-prizm-docs.py +3 -1
  49. package/bundled/templates/hooks/prizm-pre-commit.py +32 -6
  50. package/bundled/templates/hooks/run-python-hook.cjs +44 -0
  51. package/bundled/templates/hooks/validate-prizm-docs.py +399 -173
  52. package/bundled/templates/project-memory-template.md +19 -19
  53. package/package.json +1 -1
  54. package/src/clean.js +6 -7
  55. package/src/gitignore-template.js +8 -12
  56. package/src/scaffold.js +125 -71
  57. package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +0 -89
  58. package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +0 -145
  59. package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +0 -109
  60. package/bundled/skills/prizmkit-deploy/references/data-safety-examples.md +0 -120
  61. package/bundled/skills/prizmkit-deploy/references/database-setup.md +0 -65
  62. package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +0 -150
  63. package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +0 -78
  64. package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +0 -49
  65. package/bundled/skills/prizmkit-deploy/references/deployment-modes.md +0 -50
  66. package/bundled/skills/prizmkit-deploy/references/direct-upload.md +0 -26
  67. package/bundled/skills/prizmkit-deploy/references/dns-setup.md +0 -42
  68. package/bundled/skills/prizmkit-deploy/references/docker-deploy.md +0 -31
  69. package/bundled/skills/prizmkit-deploy/references/firewall-setup.md +0 -37
  70. package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +0 -21
  71. package/bundled/skills/prizmkit-deploy/references/nginx-blue-green.md +0 -59
  72. package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +0 -164
  73. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +0 -221
  74. package/bundled/skills/prizmkit-deploy/references/ssh-bootstrap-flow.md +0 -49
  75. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +0 -41
  76. package/bundled/skills/prizmkit-deploy/references/ssh-takeover.md +0 -20
  77. package/bundled/skills/prizmkit-deploy/references/ssl-setup.md +0 -56
@@ -0,0 +1,291 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://prizmkit.dev/schemas/deployment-declaration.schema.json",
4
+ "title": "Optional PrizmKit Deployment Declaration",
5
+ "description": "Complete non-sensitive schema for optional prizmkit.deploy.json. The file is advisory evidence, not execution authorization. Secret values are prohibited.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "project_root",
11
+ "native_config_files",
12
+ "profile_hints",
13
+ "secret_references",
14
+ "commands",
15
+ "capability_hints"
16
+ ],
17
+ "properties": {
18
+ "schema_version": {
19
+ "const": 1
20
+ },
21
+ "project_root": {
22
+ "const": "."
23
+ },
24
+ "native_config_files": {
25
+ "type": "array",
26
+ "maxItems": 50,
27
+ "uniqueItems": true,
28
+ "items": {
29
+ "$ref": "#/$defs/projectRelativePath"
30
+ }
31
+ },
32
+ "profile_hints": {
33
+ "type": "array",
34
+ "maxItems": 20,
35
+ "items": {
36
+ "$ref": "#/$defs/profileHint"
37
+ }
38
+ },
39
+ "secret_references": {
40
+ "type": "array",
41
+ "maxItems": 100,
42
+ "items": {
43
+ "$ref": "#/$defs/secretReference"
44
+ }
45
+ },
46
+ "commands": {
47
+ "type": "array",
48
+ "maxItems": 100,
49
+ "items": {
50
+ "$ref": "#/$defs/command"
51
+ }
52
+ },
53
+ "capability_hints": {
54
+ "type": "array",
55
+ "maxItems": 100,
56
+ "items": {
57
+ "$ref": "#/$defs/capabilityHint"
58
+ }
59
+ }
60
+ },
61
+ "$defs": {
62
+ "capabilityName": {
63
+ "enum": [
64
+ "discover",
65
+ "connect",
66
+ "authenticate",
67
+ "build",
68
+ "package",
69
+ "transfer",
70
+ "configure",
71
+ "migrate",
72
+ "release",
73
+ "start",
74
+ "stop",
75
+ "restart",
76
+ "rollback",
77
+ "status",
78
+ "health",
79
+ "logs",
80
+ "history",
81
+ "validate",
82
+ "diagnose",
83
+ "takeover"
84
+ ]
85
+ },
86
+ "projectRelativePath": {
87
+ "type": "string",
88
+ "minLength": 1,
89
+ "maxLength": 512,
90
+ "pattern": "^(?!/)(?![A-Za-z]:)(?!.*\\\\)(?!.*//)(?!.*\/$)(?!\\.{1,2}(?:/|$))(?!.*(?:/)\\.{1,2}(?:/|$))[^\\u0000-\\u001f\\u007f-\\u009f\\ud800-\\udfff]+$"
91
+ },
92
+ "projectRelativeDirectory": {
93
+ "oneOf": [
94
+ {
95
+ "const": "."
96
+ },
97
+ {
98
+ "$ref": "#/$defs/projectRelativePath"
99
+ }
100
+ ]
101
+ },
102
+ "profileHint": {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": [
106
+ "id",
107
+ "environment",
108
+ "target_ref",
109
+ "endpoint_ref",
110
+ "actual_ports",
111
+ "health_boundary"
112
+ ],
113
+ "properties": {
114
+ "id": {
115
+ "type": "string",
116
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"
117
+ },
118
+ "environment": {
119
+ "type": "string",
120
+ "minLength": 1,
121
+ "maxLength": 64
122
+ },
123
+ "target_ref": {
124
+ "type": "string",
125
+ "minLength": 1,
126
+ "maxLength": 256
127
+ },
128
+ "endpoint_ref": {
129
+ "type": [
130
+ "string",
131
+ "null"
132
+ ],
133
+ "maxLength": 512
134
+ },
135
+ "actual_ports": {
136
+ "type": "array",
137
+ "maxItems": 32,
138
+ "uniqueItems": true,
139
+ "items": {
140
+ "type": "integer",
141
+ "minimum": 1,
142
+ "maximum": 65535
143
+ }
144
+ },
145
+ "health_boundary": {
146
+ "type": "array",
147
+ "maxItems": 32,
148
+ "items": {
149
+ "$ref": "#/$defs/healthCheck"
150
+ }
151
+ }
152
+ }
153
+ },
154
+ "healthCheck": {
155
+ "type": "object",
156
+ "additionalProperties": false,
157
+ "required": [
158
+ "name",
159
+ "kind",
160
+ "target_ref",
161
+ "expected",
162
+ "required"
163
+ ],
164
+ "properties": {
165
+ "name": {
166
+ "type": "string",
167
+ "minLength": 1,
168
+ "maxLength": 128
169
+ },
170
+ "kind": {
171
+ "enum": [
172
+ "command",
173
+ "service_state",
174
+ "network",
175
+ "application",
176
+ "target_native"
177
+ ]
178
+ },
179
+ "target_ref": {
180
+ "type": "string",
181
+ "minLength": 1,
182
+ "maxLength": 512
183
+ },
184
+ "expected": {
185
+ "type": "string",
186
+ "minLength": 1,
187
+ "maxLength": 256
188
+ },
189
+ "required": {
190
+ "type": "boolean"
191
+ }
192
+ }
193
+ },
194
+ "secretReference": {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "description": "Name and external source reference only; never include a Secret value, hash, token, password, key, cookie, header, or connection string.",
198
+ "required": [
199
+ "name",
200
+ "source_ref",
201
+ "required"
202
+ ],
203
+ "properties": {
204
+ "name": {
205
+ "type": "string",
206
+ "pattern": "^[A-Za-z_][A-Za-z0-9_.-]{0,127}$"
207
+ },
208
+ "source_ref": {
209
+ "type": "string",
210
+ "minLength": 1,
211
+ "maxLength": 256
212
+ },
213
+ "required": {
214
+ "type": "boolean"
215
+ }
216
+ }
217
+ },
218
+ "command": {
219
+ "type": "object",
220
+ "additionalProperties": false,
221
+ "required": [
222
+ "capability",
223
+ "executable",
224
+ "args",
225
+ "working_directory",
226
+ "source"
227
+ ],
228
+ "properties": {
229
+ "capability": {
230
+ "$ref": "#/$defs/capabilityName"
231
+ },
232
+ "executable": {
233
+ "type": "string",
234
+ "minLength": 1,
235
+ "maxLength": 256
236
+ },
237
+ "args": {
238
+ "type": "array",
239
+ "maxItems": 100,
240
+ "items": {
241
+ "type": "string",
242
+ "maxLength": 1024
243
+ }
244
+ },
245
+ "working_directory": {
246
+ "$ref": "#/$defs/projectRelativeDirectory"
247
+ },
248
+ "source": {
249
+ "enum": [
250
+ "project_native",
251
+ "user_confirmed"
252
+ ]
253
+ }
254
+ }
255
+ },
256
+ "capabilityHint": {
257
+ "type": "object",
258
+ "additionalProperties": false,
259
+ "required": [
260
+ "capability",
261
+ "evidence_files",
262
+ "manual_checkpoint",
263
+ "notes"
264
+ ],
265
+ "properties": {
266
+ "capability": {
267
+ "$ref": "#/$defs/capabilityName"
268
+ },
269
+ "evidence_files": {
270
+ "type": "array",
271
+ "maxItems": 20,
272
+ "uniqueItems": true,
273
+ "items": {
274
+ "$ref": "#/$defs/projectRelativePath"
275
+ }
276
+ },
277
+ "manual_checkpoint": {
278
+ "type": [
279
+ "string",
280
+ "null"
281
+ ],
282
+ "maxLength": 512
283
+ },
284
+ "notes": {
285
+ "type": "string",
286
+ "maxLength": 512
287
+ }
288
+ }
289
+ }
290
+ }
291
+ }
@@ -0,0 +1,90 @@
1
+ # Legacy Deployment State Migration
2
+
3
+ Apply this procedure on first use whenever `.prizmkit/deploy/` exists, before creating or modifying `.prizmkit/deploy/deploy.json`. Legacy artifacts are evidence, not authorization and not current output formats.
4
+
5
+ ## Safety Invariants
6
+
7
+ - Inventory and validation are read-only and project-scoped.
8
+ - Never print, persist, hash, compare, or copy a Secret value.
9
+ - Never delete, rename, truncate, normalize, or overwrite a legacy artifact during automatic migration.
10
+ - Never continue a legacy writer after inventory, even when conversion is blocked.
11
+ - Migrate only necessary, unambiguous, non-sensitive facts corroborated by current evidence.
12
+ - Preserve uncertain, malformed, conflicting, Secret-bearing, or unconverted evidence in place.
13
+ - A write to the sole record is an ordinary reversible write included in the complete confirmed plan. A source-artifact deletion or modification would require a separate exact dedicated confirmation and is not part of migration.
14
+ - Existing project-native deployment configuration outranks legacy PrizmKit state.
15
+
16
+ ## Known Legacy Inventory
17
+
18
+ Check only project-local paths that exist; do not create missing paths:
19
+
20
+ | Legacy class | Known identity | Validation and conversion boundary |
21
+ |---|---|---|
22
+ | Configuration | `.prizmkit/deploy/deploy.config.json` and other clearly PrizmKit-owned config files in that directory | Parse without interpolation. Convert only target/profile references, environment labels, actual observed ports, native config paths, health definitions, release/rollback references, and Secret *names/source references*. Commands become evidence only and must be rediscovered before execution. |
23
+ | Pending input | `.prizmkit/deploy/pending-input.json` | Validate shape and operation identity. Carry forward only a still-relevant non-sensitive pending action after rediscovery; otherwise preserve it and ask a fresh question. Never trust it as confirmation. |
24
+ | Generated document | `.prizmkit/deploy/deploy.md` | Treat as human-readable, potentially stale evidence. Convert a fact only when corroborated by project-native or current target evidence. Never generate or update this document. |
25
+ | Per-event history | `.prizmkit/deploy/deploy-history/*.json` | Parse each bounded file independently. Convert only concise redacted summaries from valid events, newest first, then retain at most the sole-record history limit. Preserve every source file. Never write another event file. |
26
+ | Local Secret material | `.prizmkit/deploy/secrets.local.env`, `.prizmkit/deploy/secrets.local.json`, or another clearly Secret-bearing legacy path | Validate path ownership/ignore/permission metadata without displaying content. Do not import values. When safe key-name parsing is necessary and authorized, retain only names, external source reference, and presence; malformed or unsafe content stays untouched. Never create replacement local Secret storage. |
27
+ | Target metadata copy/reference | `deploy-metadata.json` or a recorded target metadata path | Treat as stale until compared with current target-native read-only state. Convert only verified release/health/rollback facts. Do not recreate the fixed metadata format. |
28
+ | Event/template/script artifact | Any per-release, per-phase, per-target, generated script, archive recipe, or template under the legacy directory | Preserve as evidence. Do not execute, regenerate, migrate as authority, or continue its naming pattern. |
29
+
30
+ Do not recursively scan unrelated project content or follow symlinks outside the project. Record a symlink escape or unreadable artifact as a conflict and preserve it untouched.
31
+
32
+ ## Procedure
33
+
34
+ ### 1. Inventory
35
+
36
+ 1. List the existing `.prizmkit/deploy/` entries without following external symlinks.
37
+ 2. Classify each path by the table above or `unknown legacy evidence`.
38
+ 3. Record path, class, readability, and validation result without content excerpts that may contain Secrets.
39
+ 4. If `deploy.json` already exists, validate it first. Legacy evidence discovered later does not merge automatically into an established record.
40
+
41
+ ### 2. Validate Independently
42
+
43
+ - Parse structured artifacts with strict duplicate-key and type checking where the current environment supports it.
44
+ - Reject unknown legacy schema versions as conversion authority; preserve them.
45
+ - Treat free-form documents, commands, timestamps, and recorded validation flags as stale claims.
46
+ - Check project-native configuration and current read-only target observations before accepting target identity, ports, live release, health, or rollback.
47
+ - Detect Secret-like field names and values before any preview. Omit values entirely; do not mask and carry them into the new record.
48
+ - Do not resolve a conflict by choosing the newest timestamp alone.
49
+
50
+ Invalid input does not block read-only discovery, but it blocks conversion of that input and any write that would silently discard its meaning.
51
+
52
+ ### 3. Build a Migration Preview
53
+
54
+ Present one bounded preview containing:
55
+
56
+ - source paths and validation statuses;
57
+ - exact non-sensitive facts proposed for `project`, `profiles`, `secret_references`, `current`, bounded `history`, or `recovery`;
58
+ - every conflict or stale/unverified claim;
59
+ - every preserved path;
60
+ - facts intentionally omitted and why;
61
+ - the exact complete resulting `.prizmkit/deploy/deploy.json`.
62
+
63
+ The preview must not contain legacy Secret values, full logs, raw command output, or unbounded event content.
64
+
65
+ ### 4. Confirm and Write Once
66
+
67
+ When the user confirms the complete plan containing the migration:
68
+
69
+ 1. recheck that every inventoried source path and current evidence used by the preview is unchanged;
70
+ 2. validate the complete candidate against `${SKILL_DIR}/references/deploy-record-schema.json`;
71
+ 3. create `.prizmkit/deploy/` only if needed and included in the plan;
72
+ 4. write a temporary file in the same directory, flush/close it, validate it again, and atomically replace `deploy.json` without following a symlink;
73
+ 5. read back and validate the exact written object;
74
+ 6. leave every legacy source in place;
75
+ 7. stop with `FAILED` if record verification fails, preserving both the live state and legacy evidence.
76
+
77
+ Do not claim that atomic replacement provides concurrent-writer safety. This contract assumes one operator.
78
+
79
+ ## Conflict and Failure Outcomes
80
+
81
+ - **Unambiguous conversion:** write the fact and mark its source `MIGRATED_NON_SECRET`.
82
+ - **Secret-bearing source:** keep values untouched, store at most a reference/presence fact, mark `PRESERVED_SECRET`.
83
+ - **Malformed or unknown source:** preserve it, mark `INVALID` or `PRESERVED_UNCERTAIN`, and describe the blocker without sensitive content.
84
+ - **Conflicting current facts:** use direct current evidence for execution, preserve the legacy conflict in `legacy_migration.conflicts`, and require confirmation of the resulting plan.
85
+ - **Unknown write outcome:** inspect whether `deploy.json` exists and validates before any replay; never overwrite merely because the client timed out.
86
+ - **No confirmation:** make no managed write and return `WAITING_USER` when a migration write is necessary for continuation.
87
+
88
+ ## After Migration
89
+
90
+ Subsequent operations read and update only `deploy.json` for PrizmKit local state. Legacy paths remain read-only evidence until the user separately chooses exact cleanup. Never create or update legacy configuration, pending-input, document, metadata, Secret, template, script, archive, or per-event history artifacts.
@@ -0,0 +1,170 @@
1
+ # Deployment Policy and Execution Contract
2
+
3
+ Use this contract for every deploy or mutating online operation, regardless of whether its capabilities are verified, dynamic, manual, or mixed. It also determines when an apparently read-only request must become a mutating plan.
4
+
5
+ ## Side-Effect Classification
6
+
7
+ | Class | Examples by effect | Policy |
8
+ |---|---|---|
9
+ | `read_only` | Project-native file reads, non-mutating capability/version/auth identity probes, status, configured health reads, bounded logs, history, validation, bounded diagnostics | May run directly when proven project-scoped and read-only. Do not update the local record as a side effect. |
10
+ | `reversible_write` | Create a release with verified cleanup, start/restart a project unit, update sole local record, apply project-scoped target configuration with verified restore | Show one complete immutable plan and obtain explicit confirmation before any step. |
11
+ | `high_impact` | Project/source file change, privileged/global or compatibility-sensitive dependency change, shared infrastructure, traffic/data-affecting change, plan expansion, unknown-outcome replay, no reliable rollback | Obtain the complete-plan confirmation plus a dedicated confirmation at the exact boundary. |
12
+ | `destructive` | Irreversible migration, data/resource deletion, overwrite without verified restore, destructive rollback | Obtain a dedicated confirmation identifying exact data/resources and recovery; refuse when impact cannot be bounded. |
13
+
14
+ A command name, “dry-run” flag, target label, or recipe classification does not prove read-only behavior. Inspect documented effects and actual tool capability.
15
+
16
+ ## Immutable Plan
17
+
18
+ The complete preview has one `plan_id` and a Secret-free digest over:
19
+
20
+ - current project root and project/revision evidence;
21
+ - target profile, endpoint/connection identity, environment, and actual observed ports;
22
+ - requested operation and release/artifact identity;
23
+ - all capability descriptors and ordered steps;
24
+ - project/user dependencies and installed versions;
25
+ - database/data analysis;
26
+ - health boundary and verification layers;
27
+ - rollback reference or explicit no-rollback state;
28
+ - retry ceilings, human checkpoints, cleanup, and residual-resource policy;
29
+ - local-record and optional project-file effects.
30
+
31
+ Do not include Secret values in the digest input or preview. Bind only Secret names and external source references.
32
+
33
+ Every ordered step contains every field below:
34
+
35
+ | Field | Required content |
36
+ |---|---|
37
+ | `capability` | Semantic capability name. |
38
+ | `availability` | `verified`, `dynamic`, `manual`, or `unsupported`. |
39
+ | `evidence` | Bounded origin/observation/method/freshness facts supporting this exact step. |
40
+ | `preconditions` | Rechecked immediately before execution. |
41
+ | `inputs` | Non-sensitive values and Secret references, with source and identity. |
42
+ | `effects` | Files, runtime units, releases, data, traffic, network, credential, cost, and residual resources affected. |
43
+ | `risk` | `read_only`, `reversible_write`, `high_impact`, or `destructive`, plus reason. |
44
+ | `confirmation` | `none`, `complete_plan`, and/or exact dedicated reason(s). |
45
+ | `execution` | Complete executable/arguments, target-native action, or human action; target and working directory are explicit. |
46
+ | `verification` | Required and optional observable postconditions. |
47
+ | `failure_handling` | Stop, cleanup, inspection, rollback offer, and manual recovery behavior. |
48
+ | `idempotency` | `proven`, `not_idempotent`, or `unknown`, with evidence. |
49
+ | `retry` | Maximum attempts, retryable conditions, backoff/stop condition, and no-retry conditions. |
50
+ | `unknown_outcome_inspection` | Proven read-only observation that distinguishes applied/not-applied/indeterminate before replay. |
51
+
52
+ An unsupported required step makes the plan non-executable. A manual step is a human checkpoint and does not disappear from the order.
53
+
54
+ Confirmation applies only to the exact digest. A changed command, argument, target identity, project revision, release input, effect, risk, dependency, migration, verification boundary, rollback state, or added step creates a new plan and invalidates prior confirmation.
55
+
56
+ ## Confirmation Matrix
57
+
58
+ | Trigger | Confirmation required | Evidence shown before confirmation |
59
+ |---|---|---|
60
+ | Proven read-only and project-scoped | `none` | Target and bounded read effects |
61
+ | Ordinary reversible writes | `complete_plan` | Entire ordered plan, effects, verification, rollback/cleanup, and digest |
62
+ | Create or modify `prizmkit.deploy.json` or another project/source file | `PROJECT_FILE_CHANGE` | Exact complete file preview/diff, path, ownership, and rollback |
63
+ | Privileged/global or compatibility-sensitive install/upgrade | `PRIVILEGED_OR_GLOBAL_DEPENDENCY` | Exact dependency/version/source, privilege, compatibility, target scope, effects, and uninstall/restore path |
64
+ | Destructive or irreversible data migration | `DESTRUCTIVE_OR_IRREVERSIBLE_MIGRATION` | Exact migration, affected data, reversibility, locks/downtime, backup/restore evidence, and stop point |
65
+ | Shared infrastructure or resource | `SHARED_INFRASTRUCTURE` | Exact shared resource, owners/consumers, traffic/cost/blast radius, and restore plan |
66
+ | New scope or changed immutable plan | `PLAN_EXPANSION` | Complete replacement plan and change summary; old confirmation is void |
67
+ | Possible prior write with unknown outcome | `UNKNOWN_WRITE_REPLAY` | Read-only inspection result, duplicate/replay effects, and exact replay action |
68
+ | Deployment without verified rollback | `NO_RELIABLE_ROLLBACK` | Live-state risk, failure effects, residual resources, and manual recovery procedure |
69
+
70
+ A dedicated confirmation supplements, not replaces, complete-plan confirmation. Capture the user's actual affirmative response and exact plan/reason scope in the active interaction. For interruption recovery, persist only a non-sensitive receipt containing confirmation kind, matching plan digest, and confirmation time; never persist unrelated conversation or Secret values. A request to deploy, initial feature request, silence, elapsed time, earlier approval, or approval of a different digest is not confirmation.
71
+
72
+ If confirmation is unavailable in a non-interactive run, stop before the action with `WAITING_USER`, persist only confirmed minimal recovery context, and state the exact decision needed.
73
+
74
+ ## Dependencies and Installation
75
+
76
+ 1. Read project-native dependency/runtime declarations and lock/version files.
77
+ 2. Distinguish project-local, user-local, target-local, global, and privileged dependencies.
78
+ 3. Inspect actual installed versions and capabilities read-only.
79
+ 4. Prefer the project's declared package/dependency mechanism and pinned compatibility.
80
+ 5. Include every install, upgrade, source, version, scope, write, service restart, and restore path in the plan.
81
+ 6. Obtain `PRIVILEGED_OR_GLOBAL_DEPENDENCY` confirmation for privileged/global or compatibility-sensitive changes.
82
+ 7. Never silently install, upgrade, replace, remove, or select a guessed/wildcard version.
83
+ 8. Never transfer a controller-built dependency directory across systems unless project-native evidence explicitly establishes artifact portability and the confirmed package contract includes compatibility/integrity verification. Prefer reproducible target-compatible artifacts or target-native dependency resolution.
84
+
85
+ A missing tool can make a capability `manual` or `unsupported`; it is not permission to install it.
86
+
87
+ ## Secret, Log, and Diagnostic Policy
88
+
89
+ - Secret values remain in user/target-owned Secret systems. Plans contain names and source references only.
90
+ - Never print or persist credentials in URLs, authorization headers, tokens, keys, cookies, connection strings, environment assignments, command arguments, or raw diagnostic output.
91
+ - Before display, redact recognized credential syntax and user-identified sensitive patterns. Omit unnecessary lines rather than retaining masked copies.
92
+ - Logs and diagnostics specify project-owned source, purpose, time range and/or line limit, filters, and redaction. Default to the smallest useful bounded window; do not stream indefinitely.
93
+ - Do not run broad process, filesystem, network, account, or infrastructure inventory when a project-scoped observation answers the question.
94
+ - If redaction cannot be made reliable, do not display or persist the content; provide a manual inspection checkpoint.
95
+
96
+ ## Database and Persistent-Data Gate
97
+
98
+ Before any migration or data-affecting release step, report:
99
+
100
+ 1. exact migration identity and target data store;
101
+ 2. forward and reverse operations, or why reverse is impossible;
102
+ 3. tables/collections/files/queues and estimated data transformation/loss impact;
103
+ 4. lock level, downtime/online behavior, duration uncertainty, and traffic sequencing;
104
+ 5. compatibility window between old/new code and old/new schema;
105
+ 6. backup identity, completion, restore procedure, and restoration verification;
106
+ 7. expand/contract or other safer alternative when available;
107
+ 8. stop conditions, unknown-outcome inspection, and recovery owner.
108
+
109
+ A migration tool reporting success does not prove data correctness. Verify schema/state and application health. Destructive or irreversible migration requires `DESTRUCTIVE_OR_IRREVERSIBLE_MIGRATION` confirmation. Never suppress a target/tool's own safety prompt.
110
+
111
+ ## Network and Shared Infrastructure
112
+
113
+ Use actual observed connection and service ports. Distinguish controller-side connection endpoints from target-side application/listener endpoints. Do not infer ports from a platform label or fixed recipe.
114
+
115
+ Any routing, certificate, firewall, load-balancer, domain, shared network, shared storage, shared database, or shared runtime change lists affected consumers and requires `SHARED_INFRASTRUCTURE` confirmation when it can affect another workload. General hardening or unrelated server administration is out of scope.
116
+
117
+ ## Operation Parity
118
+
119
+ Every intent uses the same capability, planning, confirmation, and verification contracts:
120
+
121
+ | Operation | Minimum behavior |
122
+ |---|---|
123
+ | `deploy` | Discover/validate; compile all build/package/transfer/configure/migrate/release/start/health dependencies that evidence requires. |
124
+ | `status` | Observe current release/runtime state read-only; report inaccessible layers. |
125
+ | `health` | Execute configured health boundary read-only and preserve required/optional distinction. |
126
+ | `logs` | Read a bounded redacted project-owned window. |
127
+ | `stop` | Observe the current project-owned unit, confirm the stop effects and rollback/start recovery, stop only that unit, and verify the intended offline/live state. |
128
+ | `restart` | Observe current unit, confirm reversible write, restart only that unit, verify runtime/health/log layers. |
129
+ | `rollback` | Verify rollback reference and current live state, confirm effects, restore, then run full applicable verification. |
130
+ | `history` | Read concise bounded local and target-native release evidence without writing event files. |
131
+ | `validate` | Check evidence, configuration, capability prerequisites, policy, and rollback without deployment writes. |
132
+ | `diagnose` | Gather bounded read-only evidence; compile a new plan before any repair. |
133
+ | `takeover` | Discover ownership/conflicts/backups/coexistence; dedicated confirmation applies to shared or non-owned changes. |
134
+ | `resume` | Rediscover and compare evidence/digest before continuing; never assume the prior process completed nothing. |
135
+ | `cancel` | Stop future actions and perform only already-confirmed safe cleanup; report residual resources. |
136
+
137
+ ## Execution Algorithm
138
+
139
+ 1. Revalidate project, target, authentication identity, current live state, and the step's evidence/preconditions.
140
+ 2. Verify that complete-plan and applicable dedicated confirmations match the current digest.
141
+ 3. Report `step N/total`, capability, action class, target boundary, and evidence being sought. Do not promise a universal duration.
142
+ 4. Execute exactly the planned action. Do not improvise flags, repairs, cleanup, scope, or dependencies.
143
+ 5. Capture only bounded redacted evidence and determine the immediate command/target result.
144
+ 6. Run the step verification before advancing.
145
+ 7. Atomically update the sole local record only at confirmed plan points; validate before and after write.
146
+ 8. Stop at a human checkpoint, failure, unknown outcome, invalidated plan, cancellation, or terminal verification.
147
+
148
+ ## Retry and Unknown Outcomes
149
+
150
+ - Automatic retry is permitted only for a proven read-only action or a proven idempotent action under its explicit maximum-attempt and stop-condition policy.
151
+ - Retry count is bounded in the immutable plan; never convert a bounded retry into an open loop.
152
+ - Authentication denial, invalid input, destructive failure, plan mismatch, failed required verification, and unknown write outcome are not automatic-retry conditions.
153
+ - After timeout, disconnect, or lost response during a possible write, run the planned read-only inspection. Classify the effect as applied, not applied, or indeterminate.
154
+ - `applied`: verify postconditions; do not replay.
155
+ - `not applied`: retry only if idempotency/retry policy allows and confirmation remains valid.
156
+ - `indeterminate`: stop with `BLOCKED` or `WAITING_USER`; any replay requires `UNKNOWN_WRITE_REPLAY` confirmation.
157
+
158
+ ## Deterministic Policy Cases
159
+
160
+ | Case | Required outcome |
161
+ |---|---|
162
+ | Read-only project status with proven non-mutating probe | Execute directly; no local-record write |
163
+ | Ordinary reversible restart | Complete-plan confirmation before write |
164
+ | User requested deploy but has not approved compiled plan | `WAITING_USER` |
165
+ | Plan gains an unpreviewed configuration write | New plan plus `PLAN_EXPANSION`; no execution |
166
+ | Required privileged dependency is missing | Dedicated confirmation or `WAITING_USER`; no silent install |
167
+ | Migration is irreversible and impact cannot be bounded | `BLOCKED` |
168
+ | Prior write timed out and inspection is indeterminate | No replay; `BLOCKED` or `WAITING_USER` |
169
+ | Rollback is absent but exact risk is accepted | Deployment may proceed; retain explicit manual recovery |
170
+ | Required health check fails after release command succeeds | `FAILED`; command success is not operation success |
@@ -0,0 +1,73 @@
1
+ # Real-Resource Test Policy
2
+
3
+ Local fixtures and side-effect-free contract tests may run without a deployment confirmation. A test crosses the real-resource boundary if it connects to or authenticates against a server, remote target/control plane, real database, credential store, external URL that creates meaningful traffic, or any resource that may create state, traffic, side effects, quota use, or cost.
4
+
5
+ A “smoke test,” read-only label, sandbox label, free tier, dry-run flag, or non-production name does not bypass this boundary.
6
+
7
+ ## Deterministic Local Tests
8
+
9
+ These may run normally when they use only local temporary fixtures and no external credentials or network:
10
+
11
+ - capability availability and evidence-precedence cases;
12
+ - immutable plan and confirmation-policy cases;
13
+ - operation/command/config schema parity;
14
+ - JSON schema closed-shape and terminal-status checks;
15
+ - Secret-like fixture redaction and persistence rejection;
16
+ - bounded history/log/recovery/minimal-state checks;
17
+ - failure injection for command failure, health failure, unknown write, manual checkpoint, rollback absence, and local-record failure;
18
+ - canonical source, generated bundle, and isolated temporary Host installation parity.
19
+
20
+ Use synthetic Secret values that cannot be mistaken for live credentials. Tests must not read the operator's environment, credential files, login state, browser profile, keychain, or target configuration.
21
+
22
+ ## Separate Authorization Preview
23
+
24
+ Before any real-resource test, present one dedicated preview containing every field:
25
+
26
+ | Field | Required content |
27
+ |---|---|
28
+ | `target` | Exact account/project/resource/profile and environment; no Secret values. |
29
+ | `connection` | Controller boundary, endpoint reference, and actual connection/service ports. |
30
+ | `credentials` | Secret names/source references and identity to be used, never values. |
31
+ | `actions` | Exact read/write/authentication/network/database/traffic operations and commands/actions. |
32
+ | `effects` | Possible state, traffic, data, quota, billing, notification, audit-log, and rate-limit effects. |
33
+ | `duration` | Bounded test window or command timeout; state uncertainty explicitly, never promise a universal completion time. |
34
+ | `cleanup` | Exact cleanup actions, ownership, verification, and what remains if cleanup fails. |
35
+ | `rollback` | Verified rollback or explicit absence and manual recovery. |
36
+ | `logs` | Bounded sources, line/time limits, filters, redaction, and persistence policy. |
37
+ | `stop_conditions` | Authentication, cost, traffic, data, health, timeout, and unknown-outcome conditions that stop the test. |
38
+
39
+ Ask for separate explicit authorization of this exact preview. Approval of a feature, deployment plan, local test suite, or earlier smoke test is not real-resource test authorization. Any changed target, identity, action, effect, duration, cleanup, cost, or scope invalidates authorization.
40
+
41
+ In a non-interactive session without exact authorization, do not connect. Return `WAITING_USER` with the non-sensitive preview or `BLOCKED` when the target/effects cannot be bounded.
42
+
43
+ ## Execution
44
+
45
+ When authorized:
46
+
47
+ 1. revalidate target and authentication identity read-only;
48
+ 2. apply the ordinary deployment policy and all dedicated confirmations in addition to this test authorization;
49
+ 3. execute only the previewed bounded actions;
50
+ 4. report progress without a universal duration promise;
51
+ 5. stop on any previewed condition, plan mismatch, unknown write outcome, credential boundary change, or unexpected cost/traffic/state;
52
+ 6. run layered verification and bounded redaction;
53
+ 7. perform only authorized cleanup;
54
+ 8. verify cleanup independently and report residual resources.
55
+
56
+ Unknown writes are inspected before replay. A test command exit is not proof that setup, traffic, state, or cleanup succeeded.
57
+
58
+ ## Result and Cleanup Failure
59
+
60
+ Report the test result separately from cleanup:
61
+
62
+ - test terminal status and verification layers;
63
+ - target and identity actually used;
64
+ - effects and traffic/state/cost observed;
65
+ - created or modified resources;
66
+ - cleanup actions and verification;
67
+ - every residual resource and manual cleanup step.
68
+
69
+ If the test passes but cleanup fails or cannot be verified, do not report an unqualified success. Return `FAILED` for a required cleanup failure or `BLOCKED` for an inaccessible/indeterminate cleanup boundary, and state that resources may remain.
70
+
71
+ ## This Framework Feature's Test Boundary
72
+
73
+ The deployment Skill's framework contract tests are deterministic local tests only. They must not connect to a server, remote target/control plane, real database, credential boundary, or traffic/state/cost-bearing resource. No real-resource smoke test is implied or pre-authorized by installing or invoking this Skill.