@acidicsoil/portable-capabilities 0.1.5 → 0.1.8
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 +12 -0
- package/README.md +31 -62
- package/dist-release/catalog/roles/acceptance-criteria-synthesis.yaml +84 -0
- package/dist-release/catalog/roles/anti-pattern-inversion.yaml +83 -0
- package/dist-release/catalog/roles/behavior-preserving-refactor.yaml +88 -0
- package/dist-release/catalog/roles/canonical-exemplar-generalization.yaml +84 -0
- package/dist-release/catalog/roles/constrained-exemplar-adaptation.yaml +85 -0
- package/dist-release/catalog/roles/convention-mining.yaml +81 -0
- package/dist-release/catalog/roles/conversation-to-specification.yaml +83 -0
- package/dist-release/catalog/roles/delta-analysis.yaml +84 -0
- package/dist-release/catalog/roles/domain-context-boundary.yaml +82 -0
- package/dist-release/catalog/roles/evaluation-harness-design.yaml +86 -0
- package/dist-release/catalog/roles/failure-to-guardrail.yaml +81 -0
- package/dist-release/catalog/roles/multi-exemplar-consensus.yaml +81 -0
- package/dist-release/catalog/roles/reference-trace-mapping.yaml +83 -0
- package/dist-release/catalog/roles/reusable-workflow-abstraction.yaml +82 -0
- package/dist-release/catalog/roles/structural-pattern-extraction.yaml +82 -0
- package/dist-release/catalog/roles/template-family-generation.yaml +83 -0
- package/dist-release/catalog/schemas/acceptance-criteria-synthesis.output.schema.json +63 -0
- package/dist-release/catalog/schemas/anti-pattern-inversion.output.schema.json +63 -0
- package/dist-release/catalog/schemas/behavior-preserving-refactor.output.schema.json +63 -0
- package/dist-release/catalog/schemas/canonical-exemplar-generalization.output.schema.json +63 -0
- package/dist-release/catalog/schemas/constrained-exemplar-adaptation.output.schema.json +63 -0
- package/dist-release/catalog/schemas/convention-mining.output.schema.json +63 -0
- package/dist-release/catalog/schemas/conversation-to-specification.output.schema.json +63 -0
- package/dist-release/catalog/schemas/delta-analysis.output.schema.json +63 -0
- package/dist-release/catalog/schemas/domain-context-boundary.output.schema.json +63 -0
- package/dist-release/catalog/schemas/evaluation-harness-design.output.schema.json +73 -0
- package/dist-release/catalog/schemas/failure-to-guardrail.output.schema.json +63 -0
- package/dist-release/catalog/schemas/multi-exemplar-consensus.output.schema.json +63 -0
- package/dist-release/catalog/schemas/reference-trace-mapping.output.schema.json +63 -0
- package/dist-release/catalog/schemas/reusable-workflow-abstraction.output.schema.json +73 -0
- package/dist-release/catalog/schemas/structural-pattern-extraction.output.schema.json +63 -0
- package/dist-release/catalog/schemas/template-family-generation.output.schema.json +63 -0
- package/dist-release/cli.js +5507 -3265
- package/dist-release/cli.js.map +4 -4
- package/dist-release/index.js +5976 -3447
- package/dist-release/index.js.map +4 -4
- package/package.json +37 -42
- package/schemas/canonical-artifact.schema.json +220 -0
- package/schemas/runtime-descriptor.schema.json +338 -0
- package/schemas/runtime-evidence-claim.schema.json +87 -0
- package/canonical/exceptions/antigravity-unsupported-primitives.yaml +0 -16
- package/canonical/exceptions/claude-code-unsupported-primitives.yaml +0 -16
- package/canonical/exceptions/codex-unsupported-primitives.yaml +0 -16
- package/canonical/exceptions/dcode-unsupported-primitives.yaml +0 -16
- package/canonical/exceptions/oh-my-pi-unsupported-primitives.yaml +0 -16
- package/canonical/exceptions/opencode-unsupported-primitives.yaml +0 -16
- package/canonical/exceptions/pi-unsupported-primitives.yaml +0 -16
- package/canonical/fixtures/runtime-primitive-matrix-112.json +0 -1956
- package/canonical/runtime-primitive-policy.yaml +0 -100
- package/canonical/runtime-profiles/antigravity.yaml +0 -60
- package/canonical/runtime-profiles/claude-code.yaml +0 -65
- package/canonical/runtime-profiles/codex.yaml +0 -71
- package/canonical/runtime-profiles/dcode.yaml +0 -67
- package/canonical/runtime-profiles/oh-my-pi.yaml +0 -62
- package/canonical/runtime-profiles/opencode.yaml +0 -65
- package/canonical/runtime-profiles/pi.yaml +0 -66
- package/schemas/runtime-profile.schema.json +0 -305
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#22](https://github.com/AcidicSoil/portable-capabilities/pull/22) [`6dd4920`](https://github.com/AcidicSoil/portable-capabilities/commit/6dd49209a4b7d3ddb87f454312bbc75c5528b85f) Thanks [@AcidicSoil](https://github.com/AcidicSoil)! - Provide a Node `createRequire` bridge in generated ESM CLI bundles so bundled CommonJS code can load Node built-ins without failing at startup.
|
|
8
|
+
|
|
9
|
+
- [#22](https://github.com/AcidicSoil/portable-capabilities/pull/22) [`6dd4920`](https://github.com/AcidicSoil/portable-capabilities/commit/6dd49209a4b7d3ddb87f454312bbc75c5528b85f) Thanks [@AcidicSoil](https://github.com/AcidicSoil)! - Keep CommonJS-backed runtime dependencies external to the public ESM bundle so the globally installed CLI starts correctly under Node.js.
|
|
10
|
+
|
|
11
|
+
- [#32](https://github.com/AcidicSoil/portable-capabilities/pull/32) [`c4167b4`](https://github.com/AcidicSoil/portable-capabilities/commit/c4167b408e794ba68d5f153c9846c23b7b57b9ed) Thanks [@AcidicSoil](https://github.com/AcidicSoil)! - Make the CLI source workspace private and keep the repository root as the single npm distribution surface.
|
|
12
|
+
|
|
13
|
+
- [#22](https://github.com/AcidicSoil/portable-capabilities/pull/22) [`6dd4920`](https://github.com/AcidicSoil/portable-capabilities/commit/6dd49209a4b7d3ddb87f454312bbc75c5528b85f) Thanks [@AcidicSoil](https://github.com/AcidicSoil)! - Publish the `portable-capabilities` executable from the public package, include the canonical assets and runtime schemas in the same tarball, and verify a global-style npm installation end to end.
|
|
14
|
+
|
|
3
15
|
## 1.0.0
|
|
4
16
|
|
|
5
17
|
- Added canonical schemas, contracts, nine shared operations, six families, and 16 analytical roles.
|
package/README.md
CHANGED
|
@@ -10,24 +10,19 @@ Define an analytical coding-agent capability once, then generate and install the
|
|
|
10
10
|
|
|
11
11
|
Portable Capabilities is a contract-first compiler and CLI. A canonical capability describes its activation criteria, accepted inputs, ordered procedure, output schema, evidence requirements, and allowed effects. The compiler turns that contract into runtime-native skills, commands, agents, workflows, rules, or extensions without maintaining a separate handwritten implementation for every client.
|
|
12
12
|
|
|
13
|
-
## Review
|
|
13
|
+
## Review runtime support
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
bash review/runtime-packages/codex/install.sh
|
|
19
|
-
```
|
|
15
|
+
Historical generated-package snapshots and captured native outputs for all seven runtimes are available in [`review/runtime-packages`](review/runtime-packages/README.md). Use the typed CLI for current installation; the snapshots do not define the active command surface.
|
|
20
16
|
|
|
21
17
|
## Try it
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
Inspect the current command surface:
|
|
24
20
|
|
|
25
21
|
```bash
|
|
26
|
-
pnpm
|
|
22
|
+
pnpm cli -- --help
|
|
23
|
+
pnpm cli -- runtimes
|
|
27
24
|
```
|
|
28
25
|
|
|
29
|
-
This builds the canonical `acceptance-criteria-synthesis` capability for Codex, installs it into a clean project, invokes it through Codex, and writes the result to `.demo/result.md`.
|
|
30
|
-
|
|
31
26
|
## What problem does it solve?
|
|
32
27
|
|
|
33
28
|
Coding-agent clients discover and activate reusable behavior differently. The same capability may require a skill directory in one client, a slash command in another, a subagent definition elsewhere, and different permission metadata in each package.
|
|
@@ -72,7 +67,7 @@ Every generated package retains a `SKILL.md` behavioral core plus its required r
|
|
|
72
67
|
|
|
73
68
|
## Runtime packages
|
|
74
69
|
|
|
75
|
-
The project generates packages for seven clients. Package generation is not the same as authoritative behavioral certification: the runtime
|
|
70
|
+
The project generates packages for seven clients. Package generation is not the same as authoritative behavioral certification: the runtime descriptor and retained execution evidence determine whether a client is currently supported, unavailable, unsupported, or covered by an approved exception.
|
|
76
71
|
|
|
77
72
|
| Runtime | Native primitives | Package and verification guide |
|
|
78
73
|
| ------------------ | --------------------- | ------------------------------------------- |
|
|
@@ -105,63 +100,37 @@ The package installs the executable into npm's configured global binary director
|
|
|
105
100
|
|
|
106
101
|
While working from this repository, replace `portable-capabilities` in the examples with `pnpm cli --`.
|
|
107
102
|
|
|
108
|
-
| Command
|
|
109
|
-
|
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `upgrade` | Upgrade installer-owned capability files |
|
|
119
|
-
| `downgrade` | Restore an earlier package version |
|
|
120
|
-
| `recover` | Recover an interrupted installation transaction |
|
|
121
|
-
| `remove` | Remove installer-owned files safely |
|
|
103
|
+
| Command | Purpose |
|
|
104
|
+
| ---------- | -------------------------------------------- |
|
|
105
|
+
| `wizard` | Guided capability installation |
|
|
106
|
+
| `runtimes` | List supported runtime IDs |
|
|
107
|
+
| `setup` | Plan or perform typed setup |
|
|
108
|
+
| `install` | Install one or more capabilities |
|
|
109
|
+
| `update` | Update installer-owned capability files |
|
|
110
|
+
| `status` | Inspect installation health |
|
|
111
|
+
| `remove` | Remove selected installer-owned files safely |
|
|
112
|
+
| `invoke` | Execute a verified package through the CLI |
|
|
122
113
|
|
|
123
114
|
Machine-readable commands support `--format json`.
|
|
124
115
|
|
|
125
|
-
##
|
|
116
|
+
## Set up a capability
|
|
126
117
|
|
|
127
|
-
|
|
118
|
+
Install one or more catalog capabilities into a clean project:
|
|
128
119
|
|
|
129
120
|
```bash
|
|
130
|
-
MANIFEST=/path/to/capability-system.yaml
|
|
131
|
-
RUNTIME=codex
|
|
132
|
-
CAPABILITY=<capability-id>
|
|
133
|
-
BUNDLE=/tmp/portable-capabilities-bundle
|
|
134
121
|
CONSUMER=/tmp/portable-capabilities-consumer
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Build and inspect one runtime projection:
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
pnpm cli -- build "$MANIFEST" \
|
|
141
|
-
--target "$RUNTIME" \
|
|
142
|
-
--role "$CAPABILITY" \
|
|
143
|
-
--output "$BUNDLE"
|
|
144
|
-
|
|
145
|
-
pnpm cli -- inspect "$MANIFEST" \
|
|
146
|
-
--target "$RUNTIME" \
|
|
147
|
-
--role "$CAPABILITY" \
|
|
148
|
-
--format json
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
Install it into a clean consumer project and verify installer health:
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
122
|
mkdir -p "$CONSUMER"
|
|
155
|
-
git -C "$CONSUMER" init
|
|
156
|
-
|
|
157
123
|
pnpm cli -- install \
|
|
158
|
-
--
|
|
159
|
-
--
|
|
160
|
-
--
|
|
161
|
-
--
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
124
|
+
--runtime codex \
|
|
125
|
+
--capability convention-mining \
|
|
126
|
+
--project "$CONSUMER" \
|
|
127
|
+
--approval-policy preapproved
|
|
128
|
+
|
|
129
|
+
pnpm cli -- status \
|
|
130
|
+
--runtime codex \
|
|
131
|
+
--capability convention-mining \
|
|
132
|
+
--project "$CONSUMER" \
|
|
133
|
+
--format json
|
|
165
134
|
```
|
|
166
135
|
|
|
167
136
|
Then start the selected coding-agent client from `$CONSUMER` and follow its runtime guide. Each guide documents the generated paths, native invocation syntax, user smoke test, maintainer certification procedure, and current evidence status.
|
|
@@ -170,9 +139,9 @@ Then start the selected coding-agent client from `$CONSUMER` and follow its runt
|
|
|
170
139
|
|
|
171
140
|
Portable Capabilities keeps these claims separate:
|
|
172
141
|
|
|
173
|
-
1. **Static package validation** proves file layout, schemas, resources,
|
|
174
|
-
2. **Clean installation validation** proves the packed CLI can install,
|
|
175
|
-
3. **Native client execution** proves the real client discovered and invoked the generated
|
|
142
|
+
1. **Static package validation** proves file layout, schemas, resources, and integrity metadata.
|
|
143
|
+
2. **Clean installation validation** proves the packed CLI can install, update, status-check, and remove generated capabilities in a disposable project.
|
|
144
|
+
3. **Native client execution** proves the real client discovered and invoked the generated capability.
|
|
176
145
|
4. **Behavioral conformance** proves the client consumed the operational instructions, produced schema-valid output, preserved evidence requirements, and respected effects.
|
|
177
146
|
|
|
178
147
|
A static or simulated pass must not be reported as native behavioral support. See [Testing](docs/TESTING.md).
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
schemaVersion: '1.0'
|
|
2
|
+
id: acceptance-criteria-synthesis
|
|
3
|
+
purpose: Derive measurable acceptance criteria from intent and evidence.
|
|
4
|
+
family:
|
|
5
|
+
id: guardrails-evaluation
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
taxonomy:
|
|
8
|
+
id: acceptance-criteria-synthesis
|
|
9
|
+
displayName: Acceptance Criteria Synthesis
|
|
10
|
+
transformation: Derive measurable acceptance criteria from intent and evidence.
|
|
11
|
+
intendedOutput: Acceptance criteria set
|
|
12
|
+
inputs:
|
|
13
|
+
- name: intent-and-requirements
|
|
14
|
+
description: The intent, requirements, or obligations to be accepted.
|
|
15
|
+
required: true
|
|
16
|
+
- name: implementation-evidence
|
|
17
|
+
description: Evidence about the system or artifact under evaluation.
|
|
18
|
+
required: false
|
|
19
|
+
- name: quality-thresholds
|
|
20
|
+
description: Measurable thresholds and tolerances.
|
|
21
|
+
required: false
|
|
22
|
+
precedence:
|
|
23
|
+
- sourceClass: explicit-contract
|
|
24
|
+
rank: 0
|
|
25
|
+
- sourceClass: observed-artifact
|
|
26
|
+
rank: 1
|
|
27
|
+
- sourceClass: inference
|
|
28
|
+
rank: 2
|
|
29
|
+
pipeline:
|
|
30
|
+
- id: ingest.sources
|
|
31
|
+
version: 1.0.0
|
|
32
|
+
- id: trace.build-evidence-ledger
|
|
33
|
+
version: 1.0.0
|
|
34
|
+
- id: validation.contract
|
|
35
|
+
version: 1.0.0
|
|
36
|
+
output:
|
|
37
|
+
schema: canonical/schemas/acceptance-criteria-synthesis.output.schema.json
|
|
38
|
+
description: Acceptance criteria set
|
|
39
|
+
requiredBehavior:
|
|
40
|
+
- 'activation: Use acceptance-criteria-synthesis only when the requested outcome requires this transformation: Derive
|
|
41
|
+
measurable acceptance criteria from intent and evidence.'
|
|
42
|
+
- 'sufficiency: Require all role inputs marked required and enough evidence to complete these gates: Every obligation
|
|
43
|
+
maps to at least one unambiguous criterion, each criterion names evidence and pass/fail conditions, and coverage
|
|
44
|
+
gaps are explicit.'
|
|
45
|
+
- 'conflict: Apply declared source precedence; when equally authoritative evidence changes the decision, preserve
|
|
46
|
+
both positions and return the affected output field as unresolved.'
|
|
47
|
+
- 'ambiguity: Isolate ambiguous terms or boundaries, show which stage and output fields they affect, and request
|
|
48
|
+
clarification rather than selecting an unsupported interpretation.'
|
|
49
|
+
- 'abstention: Abstain from acceptance-criteria-synthesis when required inputs are absent, the decision rule cannot
|
|
50
|
+
be applied, or evidence cannot satisfy the completion gate.'
|
|
51
|
+
- 'stop: Stop before emitting Acceptance criteria set unless Every obligation maps to at least one unambiguous criterion,
|
|
52
|
+
each criterion names evidence and pass/fail conditions, and coverage gaps are explicit.'
|
|
53
|
+
- 'resources: Load requirements, governing contracts, implementation evidence, and measurement standards; load examples
|
|
54
|
+
only to clarify boundary conditions.'
|
|
55
|
+
- 'transformation: Execute the ordered analytical procedure: 1) decompose intent into observable obligations; 2)
|
|
56
|
+
identify success failure boundary and edge conditions; 3) write measurable criteria with evidence and threshold
|
|
57
|
+
requirements; 4) check completeness ambiguity independence and testability.'
|
|
58
|
+
- 'output: Populate and validate canonical/schemas/acceptance-criteria-synthesis.output.schema.json with required
|
|
59
|
+
fields criteria, evidenceRequirements, thresholds, failureConditions, coverageMap; do not replace missing fields
|
|
60
|
+
with prose.'
|
|
61
|
+
- 'traceability: Link every material output field to source identifiers and the analytical stage or decision that
|
|
62
|
+
produced it; retain counterevidence for unresolved results.'
|
|
63
|
+
- 'evaluation: Pass only when the output schema validates, the ordered stages are evidenced, the role decision rule
|
|
64
|
+
was applied, and this completion gate holds: Every obligation maps to at least one unambiguous criterion, each
|
|
65
|
+
criterion names evidence and pass/fail conditions, and coverage gaps are explicit.'
|
|
66
|
+
forbiddenBehavior:
|
|
67
|
+
- Do not substitute generic analytical behavior for the role-specific acceptance-criteria-synthesis transformation.
|
|
68
|
+
- Do not skip, reorder, or silently collapse the role's declared analytical stages.
|
|
69
|
+
- Do not invent missing evidence, resolve authority conflicts by convenience, or emit a completed result after a
|
|
70
|
+
stop or abstention condition.
|
|
71
|
+
- Do not copy operation-owned ingestion, ledger, or schema-validation mechanics into the role contract.
|
|
72
|
+
traceability:
|
|
73
|
+
materialClaimsRequireSources: true
|
|
74
|
+
ledgerFormat: jsonl
|
|
75
|
+
artifacts: content-addressed
|
|
76
|
+
evaluation:
|
|
77
|
+
criteria:
|
|
78
|
+
- The authoritative transformation and intended output for acceptance-criteria-synthesis are preserved.
|
|
79
|
+
- 'Required inputs and the decision rule are satisfied: Accept a criterion only when an independent evaluator
|
|
80
|
+
can determine pass or fail from named evidence without inferring unstated intent.'
|
|
81
|
+
- 'The ordered analytical stages are evidenced and the output completion gate passes: Every obligation maps to
|
|
82
|
+
at least one unambiguous criterion, each criterion names evidence and pass/fail conditions, and coverage gaps
|
|
83
|
+
are explicit.'
|
|
84
|
+
- Conflict, ambiguity, insufficient-evidence, abstention, and stop behavior remain explicit and testable.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
schemaVersion: '1.0'
|
|
2
|
+
id: anti-pattern-inversion
|
|
3
|
+
purpose: Invert documented anti-patterns into positive construction rules.
|
|
4
|
+
family:
|
|
5
|
+
id: corrective-transformation
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
taxonomy:
|
|
8
|
+
id: anti-pattern-inversion
|
|
9
|
+
displayName: Anti-Pattern Inversion
|
|
10
|
+
transformation: Invert documented anti-patterns into positive construction rules.
|
|
11
|
+
intendedOutput: Corrective rule set
|
|
12
|
+
inputs:
|
|
13
|
+
- name: anti-pattern-catalog
|
|
14
|
+
description: Documented anti-patterns and failure examples.
|
|
15
|
+
required: true
|
|
16
|
+
- name: construction-context
|
|
17
|
+
description: The context in which positive rules will be applied.
|
|
18
|
+
required: true
|
|
19
|
+
- name: existing-controls
|
|
20
|
+
description: Existing rules or controls that may overlap.
|
|
21
|
+
required: false
|
|
22
|
+
precedence:
|
|
23
|
+
- sourceClass: explicit-contract
|
|
24
|
+
rank: 0
|
|
25
|
+
- sourceClass: observed-artifact
|
|
26
|
+
rank: 1
|
|
27
|
+
- sourceClass: inference
|
|
28
|
+
rank: 2
|
|
29
|
+
pipeline:
|
|
30
|
+
- id: ingest.sources
|
|
31
|
+
version: 1.0.0
|
|
32
|
+
- id: trace.build-evidence-ledger
|
|
33
|
+
version: 1.0.0
|
|
34
|
+
- id: validation.contract
|
|
35
|
+
version: 1.0.0
|
|
36
|
+
output:
|
|
37
|
+
schema: canonical/schemas/anti-pattern-inversion.output.schema.json
|
|
38
|
+
description: Corrective rule set
|
|
39
|
+
requiredBehavior:
|
|
40
|
+
- 'activation: Use anti-pattern-inversion only when the requested outcome requires this transformation: Invert documented
|
|
41
|
+
anti-patterns into positive construction rules.'
|
|
42
|
+
- 'sufficiency: Require all role inputs marked required and enough evidence to complete these gates: Every rule
|
|
43
|
+
traces to a harmful mechanism, passes original failure cases, and documents legitimate exceptions and overlap
|
|
44
|
+
with existing controls.'
|
|
45
|
+
- 'conflict: Apply declared source precedence; when equally authoritative evidence changes the decision, preserve
|
|
46
|
+
both positions and return the affected output field as unresolved.'
|
|
47
|
+
- 'ambiguity: Isolate ambiguous terms or boundaries, show which stage and output fields they affect, and request
|
|
48
|
+
clarification rather than selecting an unsupported interpretation.'
|
|
49
|
+
- 'abstention: Abstain from anti-pattern-inversion when required inputs are absent, the decision rule cannot be
|
|
50
|
+
applied, or evidence cannot satisfy the completion gate.'
|
|
51
|
+
- 'stop: Stop before emitting Corrective rule set unless Every rule traces to a harmful mechanism, passes original
|
|
52
|
+
failure cases, and documents legitimate exceptions and overlap with existing controls.'
|
|
53
|
+
- 'resources: Load anti-pattern evidence, construction context, existing controls, and exception examples; load
|
|
54
|
+
each failure trace to validate causal coverage.'
|
|
55
|
+
- 'transformation: Execute the ordered analytical procedure: 1) identify the harmful mechanism and triggering conditions;
|
|
56
|
+
2) derive the positive invariant that prevents the mechanism; 3) translate the invariant into actionable construction
|
|
57
|
+
and review rules; 4) test rules against original failures and legitimate exceptions.'
|
|
58
|
+
- 'output: Populate and validate canonical/schemas/anti-pattern-inversion.output.schema.json with required fields
|
|
59
|
+
antiPatternMap, positiveRules, exceptions, verificationChecks, coverageEvidence; do not replace missing fields
|
|
60
|
+
with prose.'
|
|
61
|
+
- 'traceability: Link every material output field to source identifiers and the analytical stage or decision that
|
|
62
|
+
produced it; retain counterevidence for unresolved results.'
|
|
63
|
+
- 'evaluation: Pass only when the output schema validates, the ordered stages are evidenced, the role decision rule
|
|
64
|
+
was applied, and this completion gate holds: Every rule traces to a harmful mechanism, passes original failure
|
|
65
|
+
cases, and documents legitimate exceptions and overlap with existing controls.'
|
|
66
|
+
forbiddenBehavior:
|
|
67
|
+
- Do not substitute generic analytical behavior for the role-specific anti-pattern-inversion transformation.
|
|
68
|
+
- Do not skip, reorder, or silently collapse the role's declared analytical stages.
|
|
69
|
+
- Do not invent missing evidence, resolve authority conflicts by convenience, or emit a completed result after a
|
|
70
|
+
stop or abstention condition.
|
|
71
|
+
- Do not copy operation-owned ingestion, ledger, or schema-validation mechanics into the role contract.
|
|
72
|
+
traceability:
|
|
73
|
+
materialClaimsRequireSources: true
|
|
74
|
+
ledgerFormat: jsonl
|
|
75
|
+
artifacts: content-addressed
|
|
76
|
+
evaluation:
|
|
77
|
+
criteria:
|
|
78
|
+
- The authoritative transformation and intended output for anti-pattern-inversion are preserved.
|
|
79
|
+
- 'Required inputs and the decision rule are satisfied: Adopt a positive rule only when it blocks the harmful
|
|
80
|
+
mechanism without prohibiting documented legitimate behavior.'
|
|
81
|
+
- 'The ordered analytical stages are evidenced and the output completion gate passes: Every rule traces to a harmful
|
|
82
|
+
mechanism, passes original failure cases, and documents legitimate exceptions and overlap with existing controls.'
|
|
83
|
+
- Conflict, ambiguity, insufficient-evidence, abstention, and stop behavior remain explicit and testable.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
schemaVersion: '1.0'
|
|
2
|
+
id: behavior-preserving-refactor
|
|
3
|
+
purpose: Transform structure while preserving observable behavior.
|
|
4
|
+
family:
|
|
5
|
+
id: corrective-transformation
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
taxonomy:
|
|
8
|
+
id: behavior-preserving-refactor
|
|
9
|
+
displayName: Behavior-Preserving Refactor
|
|
10
|
+
transformation: Transform structure while preserving observable behavior.
|
|
11
|
+
intendedOutput: Refactored artifact with equivalence evidence
|
|
12
|
+
inputs:
|
|
13
|
+
- name: source-artifact
|
|
14
|
+
description: The artifact to restructure.
|
|
15
|
+
required: true
|
|
16
|
+
- name: behavior-contract
|
|
17
|
+
description: Observable behavior that must be preserved.
|
|
18
|
+
required: true
|
|
19
|
+
- name: refactor-goals
|
|
20
|
+
description: Structural goals and allowed change scope.
|
|
21
|
+
required: true
|
|
22
|
+
- name: equivalence-fixtures
|
|
23
|
+
description: Tests or traces used to prove equivalence.
|
|
24
|
+
required: true
|
|
25
|
+
precedence:
|
|
26
|
+
- sourceClass: explicit-contract
|
|
27
|
+
rank: 0
|
|
28
|
+
- sourceClass: observed-artifact
|
|
29
|
+
rank: 1
|
|
30
|
+
- sourceClass: inference
|
|
31
|
+
rank: 2
|
|
32
|
+
pipeline:
|
|
33
|
+
- id: ingest.sources
|
|
34
|
+
version: 1.0.0
|
|
35
|
+
- id: trace.build-evidence-ledger
|
|
36
|
+
version: 1.0.0
|
|
37
|
+
- id: validation.contract
|
|
38
|
+
version: 1.0.0
|
|
39
|
+
output:
|
|
40
|
+
schema: canonical/schemas/behavior-preserving-refactor.output.schema.json
|
|
41
|
+
description: Refactored artifact with equivalence evidence
|
|
42
|
+
requiredBehavior:
|
|
43
|
+
- 'activation: Use behavior-preserving-refactor only when the requested outcome requires this transformation: Transform
|
|
44
|
+
structure while preserving observable behavior.'
|
|
45
|
+
- 'sufficiency: Require all role inputs marked required and enough evidence to complete these gates: All affected
|
|
46
|
+
behavior passes equivalence checks, any difference is declared out of scope or rejected, and the structural goal
|
|
47
|
+
is demonstrably achieved.'
|
|
48
|
+
- 'conflict: Apply declared source precedence; when equally authoritative evidence changes the decision, preserve
|
|
49
|
+
both positions and return the affected output field as unresolved.'
|
|
50
|
+
- 'ambiguity: Isolate ambiguous terms or boundaries, show which stage and output fields they affect, and request
|
|
51
|
+
clarification rather than selecting an unsupported interpretation.'
|
|
52
|
+
- 'abstention: Abstain from behavior-preserving-refactor when required inputs are absent, the decision rule cannot
|
|
53
|
+
be applied, or evidence cannot satisfy the completion gate.'
|
|
54
|
+
- 'stop: Stop before emitting Refactored artifact with equivalence evidence unless All affected behavior passes
|
|
55
|
+
equivalence checks, any difference is declared out of scope or rejected, and the structural goal is demonstrably
|
|
56
|
+
achieved.'
|
|
57
|
+
- 'resources: Load the source artifact, behavior contract, baseline tests, execution traces, and refactor constraints;
|
|
58
|
+
run only read-safe analysis unless an explicit execution harness is provided.'
|
|
59
|
+
- 'transformation: Execute the ordered analytical procedure: 1) establish a pre-change behavioral baseline; 2) identify
|
|
60
|
+
structural changes that do not alter the behavior contract; 3) apply changes in reversible increments; 4) compare
|
|
61
|
+
outputs side effects and failure behavior against the baseline.'
|
|
62
|
+
- 'output: Populate and validate canonical/schemas/behavior-preserving-refactor.output.schema.json with required
|
|
63
|
+
fields refactoredArtifact, changeMap, equivalenceEvidence, behavioralDiffs, rollbackNotes; do not replace missing
|
|
64
|
+
fields with prose.'
|
|
65
|
+
- 'traceability: Link every material output field to source identifiers and the analytical stage or decision that
|
|
66
|
+
produced it; retain counterevidence for unresolved results.'
|
|
67
|
+
- 'evaluation: Pass only when the output schema validates, the ordered stages are evidenced, the role decision rule
|
|
68
|
+
was applied, and this completion gate holds: All affected behavior passes equivalence checks, any difference is
|
|
69
|
+
declared out of scope or rejected, and the structural goal is demonstrably achieved.'
|
|
70
|
+
forbiddenBehavior:
|
|
71
|
+
- Do not substitute generic analytical behavior for the role-specific behavior-preserving-refactor transformation.
|
|
72
|
+
- Do not skip, reorder, or silently collapse the role's declared analytical stages.
|
|
73
|
+
- Do not invent missing evidence, resolve authority conflicts by convenience, or emit a completed result after a
|
|
74
|
+
stop or abstention condition.
|
|
75
|
+
- Do not copy operation-owned ingestion, ledger, or schema-validation mechanics into the role contract.
|
|
76
|
+
traceability:
|
|
77
|
+
materialClaimsRequireSources: true
|
|
78
|
+
ledgerFormat: jsonl
|
|
79
|
+
artifacts: content-addressed
|
|
80
|
+
evaluation:
|
|
81
|
+
criteria:
|
|
82
|
+
- The authoritative transformation and intended output for behavior-preserving-refactor are preserved.
|
|
83
|
+
- 'Required inputs and the decision rule are satisfied: Permit a structural change only when equivalence evidence
|
|
84
|
+
covers affected behavior; classify intentional behavior changes outside this role.'
|
|
85
|
+
- 'The ordered analytical stages are evidenced and the output completion gate passes: All affected behavior passes
|
|
86
|
+
equivalence checks, any difference is declared out of scope or rejected, and the structural goal is demonstrably
|
|
87
|
+
achieved.'
|
|
88
|
+
- Conflict, ambiguity, insufficient-evidence, abstention, and stop behavior remain explicit and testable.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
schemaVersion: '1.0'
|
|
2
|
+
id: canonical-exemplar-generalization
|
|
3
|
+
purpose: Transform concrete exemplars into a reusable canonical model.
|
|
4
|
+
family:
|
|
5
|
+
id: exemplar-modeling
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
taxonomy:
|
|
8
|
+
id: canonical-exemplar-generalization
|
|
9
|
+
displayName: Canonical Exemplar Generalization
|
|
10
|
+
transformation: Transform concrete exemplars into a reusable canonical model.
|
|
11
|
+
intendedOutput: Canonical generalized model
|
|
12
|
+
inputs:
|
|
13
|
+
- name: exemplars
|
|
14
|
+
description: Representative concrete exemplars to generalize.
|
|
15
|
+
required: true
|
|
16
|
+
- name: variation-samples
|
|
17
|
+
description: Counterexamples or variants used to test generality.
|
|
18
|
+
required: true
|
|
19
|
+
- name: scope-constraints
|
|
20
|
+
description: Explicit boundaries the generalized model must respect.
|
|
21
|
+
required: false
|
|
22
|
+
precedence:
|
|
23
|
+
- sourceClass: explicit-contract
|
|
24
|
+
rank: 0
|
|
25
|
+
- sourceClass: observed-artifact
|
|
26
|
+
rank: 1
|
|
27
|
+
- sourceClass: inference
|
|
28
|
+
rank: 2
|
|
29
|
+
pipeline:
|
|
30
|
+
- id: ingest.sources
|
|
31
|
+
version: 1.0.0
|
|
32
|
+
- id: trace.build-evidence-ledger
|
|
33
|
+
version: 1.0.0
|
|
34
|
+
- id: validation.contract
|
|
35
|
+
version: 1.0.0
|
|
36
|
+
output:
|
|
37
|
+
schema: canonical/schemas/canonical-exemplar-generalization.output.schema.json
|
|
38
|
+
description: Canonical generalized model
|
|
39
|
+
requiredBehavior:
|
|
40
|
+
- 'activation: Use canonical-exemplar-generalization only when the requested outcome requires this transformation:
|
|
41
|
+
Transform concrete exemplars into a reusable canonical model.'
|
|
42
|
+
- 'sufficiency: Require all role inputs marked required and enough evidence to complete these gates: Every invariant
|
|
43
|
+
is supported by multiple exemplars, every variation point is bounded, and held-out variants are either covered
|
|
44
|
+
or explicitly excluded.'
|
|
45
|
+
- 'conflict: Apply declared source precedence; when equally authoritative evidence changes the decision, preserve
|
|
46
|
+
both positions and return the affected output field as unresolved.'
|
|
47
|
+
- 'ambiguity: Isolate ambiguous terms or boundaries, show which stage and output fields they affect, and request
|
|
48
|
+
clarification rather than selecting an unsupported interpretation.'
|
|
49
|
+
- 'abstention: Abstain from canonical-exemplar-generalization when required inputs are absent, the decision rule
|
|
50
|
+
cannot be applied, or evidence cannot satisfy the completion gate.'
|
|
51
|
+
- 'stop: Stop before emitting Canonical generalized model unless Every invariant is supported by multiple exemplars,
|
|
52
|
+
every variation point is bounded, and held-out variants are either covered or explicitly excluded.'
|
|
53
|
+
- 'resources: Load the exemplar corpus, scope constraints, and held-out variation set; load each only when it contributes
|
|
54
|
+
coverage or falsification evidence.'
|
|
55
|
+
- 'transformation: Execute the ordered analytical procedure: 1) inventory invariant and variable features across
|
|
56
|
+
exemplars; 2) separate essential structure from incidental detail; 3) propose the smallest reusable model covering
|
|
57
|
+
supported variation; 4) challenge the model against held-out variants and record exclusions.'
|
|
58
|
+
- 'output: Populate and validate canonical/schemas/canonical-exemplar-generalization.output.schema.json with required
|
|
59
|
+
fields model, invariants, variationPoints, excludedDetails, coverageEvidence; do not replace missing fields with
|
|
60
|
+
prose.'
|
|
61
|
+
- 'traceability: Link every material output field to source identifiers and the analytical stage or decision that
|
|
62
|
+
produced it; retain counterevidence for unresolved results.'
|
|
63
|
+
- 'evaluation: Pass only when the output schema validates, the ordered stages are evidenced, the role decision rule
|
|
64
|
+
was applied, and this completion gate holds: Every invariant is supported by multiple exemplars, every variation
|
|
65
|
+
point is bounded, and held-out variants are either covered or explicitly excluded.'
|
|
66
|
+
forbiddenBehavior:
|
|
67
|
+
- Do not substitute generic analytical behavior for the role-specific canonical-exemplar-generalization transformation.
|
|
68
|
+
- Do not skip, reorder, or silently collapse the role's declared analytical stages.
|
|
69
|
+
- Do not invent missing evidence, resolve authority conflicts by convenience, or emit a completed result after a
|
|
70
|
+
stop or abstention condition.
|
|
71
|
+
- Do not copy operation-owned ingestion, ledger, or schema-validation mechanics into the role contract.
|
|
72
|
+
traceability:
|
|
73
|
+
materialClaimsRequireSources: true
|
|
74
|
+
ledgerFormat: jsonl
|
|
75
|
+
artifacts: content-addressed
|
|
76
|
+
evaluation:
|
|
77
|
+
criteria:
|
|
78
|
+
- The authoritative transformation and intended output for canonical-exemplar-generalization are preserved.
|
|
79
|
+
- 'Required inputs and the decision rule are satisfied: Retain a feature only when it is necessary across supported
|
|
80
|
+
exemplars or explicitly required by scope; otherwise classify it as optional or excluded.'
|
|
81
|
+
- 'The ordered analytical stages are evidenced and the output completion gate passes: Every invariant is supported
|
|
82
|
+
by multiple exemplars, every variation point is bounded, and held-out variants are either covered or explicitly
|
|
83
|
+
excluded.'
|
|
84
|
+
- Conflict, ambiguity, insufficient-evidence, abstention, and stop behavior remain explicit and testable.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
schemaVersion: '1.0'
|
|
2
|
+
id: constrained-exemplar-adaptation
|
|
3
|
+
purpose: Adapt an exemplar under explicit constraints.
|
|
4
|
+
family:
|
|
5
|
+
id: exemplar-modeling
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
taxonomy:
|
|
8
|
+
id: constrained-exemplar-adaptation
|
|
9
|
+
displayName: Constrained Exemplar Adaptation
|
|
10
|
+
transformation: Adapt an exemplar under explicit constraints.
|
|
11
|
+
intendedOutput: Constraint-compliant adaptation
|
|
12
|
+
inputs:
|
|
13
|
+
- name: source-exemplar
|
|
14
|
+
description: The exemplar whose structure or behavior is being adapted.
|
|
15
|
+
required: true
|
|
16
|
+
- name: target-constraints
|
|
17
|
+
description: Mandatory target-environment constraints.
|
|
18
|
+
required: true
|
|
19
|
+
- name: preservation-requirements
|
|
20
|
+
description: Properties that must remain unchanged.
|
|
21
|
+
required: true
|
|
22
|
+
- name: target-context
|
|
23
|
+
description: Optional target conventions and integration context.
|
|
24
|
+
required: false
|
|
25
|
+
precedence:
|
|
26
|
+
- sourceClass: explicit-contract
|
|
27
|
+
rank: 0
|
|
28
|
+
- sourceClass: observed-artifact
|
|
29
|
+
rank: 1
|
|
30
|
+
- sourceClass: inference
|
|
31
|
+
rank: 2
|
|
32
|
+
pipeline:
|
|
33
|
+
- id: ingest.sources
|
|
34
|
+
version: 1.0.0
|
|
35
|
+
- id: trace.build-evidence-ledger
|
|
36
|
+
version: 1.0.0
|
|
37
|
+
- id: validation.contract
|
|
38
|
+
version: 1.0.0
|
|
39
|
+
output:
|
|
40
|
+
schema: canonical/schemas/constrained-exemplar-adaptation.output.schema.json
|
|
41
|
+
description: Constraint-compliant adaptation
|
|
42
|
+
requiredBehavior:
|
|
43
|
+
- 'activation: Use constrained-exemplar-adaptation only when the requested outcome requires this transformation:
|
|
44
|
+
Adapt an exemplar under explicit constraints.'
|
|
45
|
+
- 'sufficiency: Require all role inputs marked required and enough evidence to complete these gates: All mandatory
|
|
46
|
+
constraints pass, preserved properties remain equivalent, and every deviation has an evidence-backed rationale.'
|
|
47
|
+
- 'conflict: Apply declared source precedence; when equally authoritative evidence changes the decision, preserve
|
|
48
|
+
both positions and return the affected output field as unresolved.'
|
|
49
|
+
- 'ambiguity: Isolate ambiguous terms or boundaries, show which stage and output fields they affect, and request
|
|
50
|
+
clarification rather than selecting an unsupported interpretation.'
|
|
51
|
+
- 'abstention: Abstain from constrained-exemplar-adaptation when required inputs are absent, the decision rule cannot
|
|
52
|
+
be applied, or evidence cannot satisfy the completion gate.'
|
|
53
|
+
- 'stop: Stop before emitting Constraint-compliant adaptation unless All mandatory constraints pass, preserved properties
|
|
54
|
+
remain equivalent, and every deviation has an evidence-backed rationale.'
|
|
55
|
+
- 'resources: Load the source exemplar, target constraint set, preservation checks, and target conventions only
|
|
56
|
+
when a mapped element depends on them.'
|
|
57
|
+
- 'transformation: Execute the ordered analytical procedure: 1) extract the exemplar properties relevant to the
|
|
58
|
+
target; 2) classify target constraints as mandatory, negotiable, or conflicting; 3) map exemplar elements to target-compatible
|
|
59
|
+
replacements; 4) validate preserved properties and document every intentional deviation.'
|
|
60
|
+
- 'output: Populate and validate canonical/schemas/constrained-exemplar-adaptation.output.schema.json with required
|
|
61
|
+
fields adaptedArtifact, constraintMapping, preservedProperties, deviations, validationResults; do not replace
|
|
62
|
+
missing fields with prose.'
|
|
63
|
+
- 'traceability: Link every material output field to source identifiers and the analytical stage or decision that
|
|
64
|
+
produced it; retain counterevidence for unresolved results.'
|
|
65
|
+
- 'evaluation: Pass only when the output schema validates, the ordered stages are evidenced, the role decision rule
|
|
66
|
+
was applied, and this completion gate holds: All mandatory constraints pass, preserved properties remain equivalent,
|
|
67
|
+
and every deviation has an evidence-backed rationale.'
|
|
68
|
+
forbiddenBehavior:
|
|
69
|
+
- Do not substitute generic analytical behavior for the role-specific constrained-exemplar-adaptation transformation.
|
|
70
|
+
- Do not skip, reorder, or silently collapse the role's declared analytical stages.
|
|
71
|
+
- Do not invent missing evidence, resolve authority conflicts by convenience, or emit a completed result after a
|
|
72
|
+
stop or abstention condition.
|
|
73
|
+
- Do not copy operation-owned ingestion, ledger, or schema-validation mechanics into the role contract.
|
|
74
|
+
traceability:
|
|
75
|
+
materialClaimsRequireSources: true
|
|
76
|
+
ledgerFormat: jsonl
|
|
77
|
+
artifacts: content-addressed
|
|
78
|
+
evaluation:
|
|
79
|
+
criteria:
|
|
80
|
+
- The authoritative transformation and intended output for constrained-exemplar-adaptation are preserved.
|
|
81
|
+
- 'Required inputs and the decision rule are satisfied: Prefer the least-divergent adaptation that satisfies all
|
|
82
|
+
mandatory constraints; abstain when two mandatory constraints cannot be jointly satisfied.'
|
|
83
|
+
- 'The ordered analytical stages are evidenced and the output completion gate passes: All mandatory constraints
|
|
84
|
+
pass, preserved properties remain equivalent, and every deviation has an evidence-backed rationale.'
|
|
85
|
+
- Conflict, ambiguity, insufficient-evidence, abstention, and stop behavior remain explicit and testable.
|