@aionis/sdk 0.2.26 → 0.2.27

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 CHANGED
@@ -148,6 +148,22 @@ procedure steps, acceptance checks, evidence refs, and the safety gate. The
148
148
  review item is read-only; it does not promote or inject the candidate into an
149
149
  Agent prompt.
150
150
 
151
+ Run the minimal review-item demo:
152
+
153
+ ```bash
154
+ npm run build
155
+ npm run example:trace-to-skill
156
+ ```
157
+
158
+ The demo prints the product path and a safe review item:
159
+
160
+ ```text
161
+ trace -> feedback attribution -> measure -> candidate -> review -> promotion gate
162
+ ```
163
+
164
+ The output proves the candidate remains `authority_state: "candidate"`,
165
+ `agent_prompt_included: false`, and `runtime_mutation: false`.
166
+
151
167
  ## Plan As Memory Asset
152
168
 
153
169
  Use `planAssetObserveEvents()` when a strong planner, reviewer, or human lead
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {
4
+ traceDerivedSkillCandidatesFromMeasure,
5
+ traceDerivedSkillReviewItemsFromMeasure,
6
+ } from "@aionis/sdk";
7
+
8
+ const measure = {
9
+ contract_version: "aionis_measure_result_v1",
10
+ effect_report: {
11
+ contract_version: "aionis_effect_report_v1",
12
+ training_candidates: [
13
+ {
14
+ candidate_type: "trace_derived_skill",
15
+ source_ids: ["effect_kernel:continuity", "run:checkout-run-001"],
16
+ label: "positive",
17
+ export_ready: true,
18
+ reason: "Positive continuity evidence produced a controlled trace-derived skill candidate.",
19
+ trace_derived_skill: {
20
+ contract_version: "aionis_trace_derived_skill_candidate_v1",
21
+ skill_name: "Continue verified execution state across sessions",
22
+ source_trace_ids: ["effect_kernel:continuity", "run:checkout-run-001"],
23
+ source_signal_ids: ["useful_continuity_improved"],
24
+ applies_when: [
25
+ "task_signature:checkout-migration",
26
+ "future_session_needs_verified_continuation",
27
+ ],
28
+ does_not_apply_when: [
29
+ "A newer memory contests, suppresses, or supersedes the source trace.",
30
+ "The current task is outside the recorded scope or task family.",
31
+ ],
32
+ procedure_steps: [
33
+ "Recover the current Aionis guide before continuing the task.",
34
+ "Continue from the verified active path instead of rediscovering prior state.",
35
+ "Keep failed commands and abandoned branches as counter-evidence, not as routes.",
36
+ "Run the recorded acceptance checks before treating the continuation as reusable.",
37
+ ],
38
+ target_files: ["src/checkout.ts"],
39
+ acceptance_checks: ["effect_kernel_passed", "comparison_evidence_sufficient"],
40
+ failure_counterexamples: ["legacy checkout route failed integration verification"],
41
+ evidence_refs: ["useful_continuity_improved", "feedback:checkout-run-001"],
42
+ authority_state: "candidate",
43
+ promotion_status: "promotion_ready",
44
+ export_policy: {
45
+ agent_prompt_included: false,
46
+ runtime_mutation: false,
47
+ required_gate: "admission_and_promotion_gate",
48
+ },
49
+ },
50
+ },
51
+ ],
52
+ },
53
+ };
54
+
55
+ const candidates = traceDerivedSkillCandidatesFromMeasure(measure);
56
+ const reviewItems = traceDerivedSkillReviewItemsFromMeasure(measure);
57
+
58
+ for (const item of reviewItems) {
59
+ if (
60
+ item.safety.authority_state !== "candidate"
61
+ || item.safety.agent_prompt_included !== false
62
+ || item.safety.runtime_mutation !== false
63
+ || item.safety.required_gate !== "admission_and_promotion_gate"
64
+ ) {
65
+ throw new Error(`Unsafe trace-derived skill review item: ${item.skill_name}`);
66
+ }
67
+ }
68
+
69
+ console.log(JSON.stringify({
70
+ product_path: "trace -> feedback attribution -> measure -> candidate -> review -> promotion gate",
71
+ candidate_count: candidates.length,
72
+ review_item_count: reviewItems.length,
73
+ review_items: reviewItems.map((item) => ({
74
+ skill_name: item.skill_name,
75
+ review_action: item.review_action,
76
+ promotion_status: item.promotion_status,
77
+ applies_when: item.applies_when,
78
+ procedure_steps: item.procedure_steps,
79
+ acceptance_checks: item.acceptance_checks,
80
+ safety: item.safety,
81
+ })),
82
+ }, null, 2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aionis/sdk",
3
- "version": "0.2.26",
3
+ "version": "0.2.27",
4
4
  "description": "TypeScript SDK facade for the Aionis state-adjudicated memory Runtime.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://docs.aionis.work/plugins/sdk",
@@ -20,6 +20,7 @@
20
20
  },
21
21
  "files": [
22
22
  "dist",
23
+ "examples",
23
24
  "README.md"
24
25
  ],
25
26
  "engines": {
@@ -27,7 +28,8 @@
27
28
  },
28
29
  "scripts": {
29
30
  "build": "tsc -p tsconfig.json",
30
- "test": "tsx --test test/*.test.ts",
31
+ "test": "npm run build --silent && tsx --test test/*.test.ts",
32
+ "example:trace-to-skill": "node examples/trace-to-skill-candidate.mjs",
31
33
  "prepack": "npm run build"
32
34
  },
33
35
  "devDependencies": {