akm-cli 0.9.0-rc.7 → 0.9.0-rc.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.
|
@@ -685,6 +685,14 @@ function assertRollbackTransitionAllowed(journal, current) {
|
|
|
685
685
|
: ["config", "state", "workflow"];
|
|
686
686
|
for (const name of unchanged) {
|
|
687
687
|
if (!sameArtifactFingerprint(journal.generation[name], current[name])) {
|
|
688
|
+
if (name === "state" &&
|
|
689
|
+
(journal.phase === "state-applied" || journal.phase === "workflow-applied") &&
|
|
690
|
+
readSingleFileBoundStateMarker(journal)?.phase === "state-applied") {
|
|
691
|
+
// SQLite rollback preserves the logical generation but may rewrite
|
|
692
|
+
// physical pages. The operation-bound canonical digest covers the full
|
|
693
|
+
// schema and every row, so it safely authenticates that rollback.
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
688
696
|
throw new ConfigError(`Refusing migration rollback because ${name} changed outside the journaled ${journal.phase} transition.`, "INVALID_CONFIG_FILE");
|
|
689
697
|
}
|
|
690
698
|
}
|
|
@@ -56,8 +56,7 @@ export function refToString(ref) {
|
|
|
56
56
|
return makeAssetRef(ref.type, ref.name, ref.origin);
|
|
57
57
|
}
|
|
58
58
|
// ── Parsing ──────────────────────────────────────────────────────────────────
|
|
59
|
-
|
|
60
|
-
export function parseAssetRef(ref) {
|
|
59
|
+
function parseLegacyAssetRef(ref, allowRetiredTypes) {
|
|
61
60
|
const trimmed = ref.trim();
|
|
62
61
|
if (!trimmed)
|
|
63
62
|
throw new UsageError("Empty ref.", "MISSING_REQUIRED_ARGUMENT");
|
|
@@ -78,20 +77,24 @@ export function parseAssetRef(ref) {
|
|
|
78
77
|
const rawName = body.slice(colon + 1);
|
|
79
78
|
// The `vault` asset type was removed in 0.9.0. Point callers at its
|
|
80
79
|
// replacements rather than failing with a generic unknown-type error.
|
|
81
|
-
if (rawType === "vault") {
|
|
80
|
+
if (!allowRetiredTypes && rawType === "vault") {
|
|
82
81
|
throw new UsageError("The `vault` asset type was removed in 0.9.0 — use `env:` (whole .env config) or `secret:` (a single value).", "MISSING_REQUIRED_ARGUMENT");
|
|
83
82
|
}
|
|
84
83
|
// Type aliases: `environment:` is an accepted spelling of the canonical `env:` type.
|
|
85
84
|
const resolvedType = TYPE_ALIASES[rawType] ?? rawType;
|
|
86
85
|
// Open type token (chunk 1.5, D1.5-6): any other non-empty type is valid ref
|
|
87
86
|
// data (foreign/adapter types included) EXCEPT the deliberately-removed set.
|
|
88
|
-
if (DEPRECATED_REJECTED_TYPES.has(resolvedType)) {
|
|
87
|
+
if (!allowRetiredTypes && DEPRECATED_REJECTED_TYPES.has(resolvedType)) {
|
|
89
88
|
throw new UsageError(`Invalid asset type: "${rawType}".`, "MISSING_REQUIRED_ARGUMENT");
|
|
90
89
|
}
|
|
91
90
|
validateName(rawName);
|
|
92
91
|
const name = normalizeName(rawName);
|
|
93
92
|
return { type: resolvedType, name, origin: origin || undefined };
|
|
94
93
|
}
|
|
94
|
+
/** Parse a legacy ref string in the format `[origin//]type:name`. */
|
|
95
|
+
export function parseAssetRef(ref) {
|
|
96
|
+
return parseLegacyAssetRef(ref, false);
|
|
97
|
+
}
|
|
95
98
|
// ── Validation (private copies — kept self-contained) ────────────────────────
|
|
96
99
|
function validateName(name) {
|
|
97
100
|
if (!name)
|
|
@@ -188,14 +191,16 @@ export function legacyRefToBundleRef(raw) {
|
|
|
188
191
|
* this is the safe superset of `parseRefInput` (input boundaries are new-only).
|
|
189
192
|
*
|
|
190
193
|
* Mapping mirrors the pre-flip input bridge exactly:
|
|
191
|
-
* - legacy input →
|
|
194
|
+
* - legacy input → historical syntax parser (including retired types).
|
|
192
195
|
* - new `conceptId` → `type`/`name` via the D-R2 reverse table.
|
|
193
196
|
* - new `bundle` → `origin`.
|
|
194
197
|
* - `#fragment` → rejected (no stored ref carries one).
|
|
195
198
|
*/
|
|
196
199
|
export function parseStoredRef(raw) {
|
|
197
200
|
if (classifyRefGrammar(raw) === "legacy") {
|
|
198
|
-
|
|
201
|
+
// Durable state may predate the removal of a type. Retired but structurally
|
|
202
|
+
// valid refs are expected orphans; current user input remains strict.
|
|
203
|
+
return parseLegacyAssetRef(raw, true);
|
|
199
204
|
}
|
|
200
205
|
const ref = parseBundleRef(raw);
|
|
201
206
|
if (ref.fragment !== undefined) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akm-cli",
|
|
3
|
-
"version": "0.9.0-rc.
|
|
3
|
+
"version": "0.9.0-rc.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "akm (Agent Knowledge Management) — A package manager for AI agent skills, commands, tools, and knowledge. Works with Claude Code, OpenCode, Cursor, and any AI coding assistant.",
|
|
6
6
|
"keywords": [
|