@adea-ai/app-framework 0.28.0 → 0.28.2

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.
@@ -4,5 +4,9 @@
4
4
  export declare function runCli(failure: string | ((error: unknown) => string), main: () => unknown, options?: {
5
5
  requireGitHubActions?: boolean;
6
6
  }): Promise<void>;
7
+ /** An error's message, safe to print: local paths and URL queries are replaced by
8
+ * placeholders, control characters dropped and the text bounded. Use it only for commands
9
+ * whose errors never embed key material. */
10
+ export declare function redactedErrorMessage(error: unknown): string;
7
11
  /** Parse a JSON file that is a regular file, not a link, of 1 to `maxBytes` bytes. */
8
12
  export declare function readJsonFile(path: string, maxBytes: number): Promise<unknown>;
@@ -12,6 +12,19 @@ async function runCli(failure, main, options = {}) {
12
12
  process.exitCode = 1;
13
13
  }
14
14
  }
15
+ var MAX_ERROR_LENGTH = 400;
16
+ /** An error's message, safe to print: local paths and URL queries are replaced by
17
+ * placeholders, control characters dropped and the text bounded. Use it only for commands
18
+ * whose errors never embed key material. */
19
+ function redactedErrorMessage(error) {
20
+ const raw = error instanceof Error ? error.message : String(error);
21
+ const redacted = Array.from(raw, (char) => {
22
+ const code = char.charCodeAt(0);
23
+ if (char === "\n" || char === " ") return " ";
24
+ return code < 32 || code === 127 ? "" : char;
25
+ }).join("").replace(/\bfile:\/\/\S+/gi, "<path>").replace(/(\bhttps?:\/\/[^\s?#'"`]+)[?#][^\s'"`]*/gi, "$1").replace(/(?<![\w.:/\\-])(?:~|[A-Za-z]:)?[\\/][^\s'"`:,;()<>]+/g, "<path>").trim();
26
+ return (redacted.length > MAX_ERROR_LENGTH ? `${redacted.slice(0, MAX_ERROR_LENGTH)}…` : redacted) || "Unknown error";
27
+ }
15
28
  /** Parse a JSON file that is a regular file, not a link, of 1 to `maxBytes` bytes. */
16
29
  async function readJsonFile(path, maxBytes) {
17
30
  const info = await lstat(path);
@@ -20,4 +33,4 @@ async function readJsonFile(path, maxBytes) {
20
33
  if (bytes.length !== info.size) throw new Error("Configuration file changed");
21
34
  return JSON.parse(bytes.toString("utf8"));
22
35
  }
23
- export { readJsonFile, runCli };
36
+ export { readJsonFile, redactedErrorMessage, runCli };
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env bun
2
- import { readJsonFile, runCli } from "./cli-runner.js";
2
+ import { readJsonFile, redactedErrorMessage, runCli } from "./cli-runner.js";
3
3
  import { gitCli } from "../release/local-provenance.js";
4
4
  import { runReleaseCutCommand } from "../release/release-cut-command.js";
5
5
  import { hostReleasePlatform, runLocalReleaseCut } from "../release/local-release.js";
6
6
  // src/cli/release-cut-cli.ts
7
7
  var local = process.argv[2] === "--local";
8
- await runCli("Unable to cut the release; check the trusted workflow or local checkout and release configuration.", async () => {
8
+ await runCli((error) => `Unable to cut the release: ${redactedErrorMessage(error)}. Check the trusted workflow or local checkout and release configuration.`, async () => {
9
9
  const [kind, path, sourceSha, ...extra] = process.argv.slice(local ? 3 : 2);
10
10
  if (kind !== "daily" && kind !== "dev" || !path || extra.length || !sourceSha !== !local) throw new Error("Invalid workflow invocation");
11
11
  const config = await readJsonFile(path, 65536);
@@ -1 +1 @@
1
- {"version":"0.28.0","commit":"83020d26992ad1f15b17cbc9fa259734cd33a5f7"}
1
+ {"version":"0.28.2","commit":"467eed71bb6f007ae6c25caae2e28534622a2b7d"}
@@ -23,6 +23,12 @@ export declare function readCommandArtifact(options: {
23
23
  entries: number;
24
24
  bytes: number;
25
25
  }>;
26
+ /**
27
+ * Whether a failed signal to a process group means no live process remains in it. macOS answers
28
+ * EPERM, not ESRCH, while the group holds only unreaped zombies. The qualification service runs
29
+ * as this user, so EPERM there does not mean a live process this user may not signal.
30
+ */
31
+ export declare function processGroupIsGone(code: string | undefined, platform?: NodeJS.Platform): boolean;
26
32
  /** The bounded result of qualifying one extracted command artifact. */
27
33
  export type CommandQualification = {
28
34
  installed: true;
@@ -133,12 +133,20 @@ async function exitedWithin(child, milliseconds) {
133
133
  clearTimeout(timer);
134
134
  }
135
135
  }
136
+ /**
137
+ * Whether a failed signal to a process group means no live process remains in it. macOS answers
138
+ * EPERM, not ESRCH, while the group holds only unreaped zombies. The qualification service runs
139
+ * as this user, so EPERM there does not mean a live process this user may not signal.
140
+ */
141
+ function processGroupIsGone(code, platform = process.platform) {
142
+ return code === "ESRCH" || platform === "darwin" && code === "EPERM";
143
+ }
136
144
  /** Signal remaining processes in the detached Unix qualification service's group. */
137
145
  function signalProcessGroup(pid, signal) {
138
146
  try {
139
147
  process.kill(-pid, signal);
140
148
  } catch (error) {
141
- if (error.code !== "ESRCH") throw error;
149
+ if (!processGroupIsGone(error.code)) throw error;
142
150
  }
143
151
  }
144
152
  async function serviceExitStatus(path) {
@@ -168,7 +176,7 @@ async function processGroupExited(pid, milliseconds) {
168
176
  try {
169
177
  process.kill(-pid, 0);
170
178
  } catch (error) {
171
- if (error.code === "ESRCH") return true;
179
+ if (processGroupIsGone(error.code)) return true;
172
180
  throw error;
173
181
  }
174
182
  if (process.platform === "linux" && await linuxProcessGroupIsExited(pid)) return true;
@@ -358,4 +366,4 @@ async function qualifyCommandArtifact(options) {
358
366
  if (!qualification) throw new Error("Command artifact qualification did not complete");
359
367
  return qualification;
360
368
  }
361
- export { commandArtifactRoot, packCommandArtifact, qualifyCommandArtifact, readCommandArtifact };
369
+ export { commandArtifactRoot, packCommandArtifact, processGroupIsGone, qualifyCommandArtifact, readCommandArtifact };
@@ -1,5 +1,25 @@
1
1
  import { gitIsAncestor } from "./local-provenance.js";
2
2
  // src/release/feed-release-cut.ts
3
+ function checkVersion(version) {
4
+ if (typeof version !== "string" || version.length > 64 || !/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/.test(version)) throw new Error("Invalid source version");
5
+ }
6
+ /** The highest `N` among `tags` of the form `v<version>-dev.N`; 0 when none. A malformed
7
+ * counter fails closed, except among bare tags (`tagsOnly`), where a name that is not a
8
+ * canonical dev tag can never collide with a cut and is skipped. */
9
+ function highestCounter(tags, version, tagsOnly = false) {
10
+ const prefix = `v${version}-dev.`;
11
+ let highest = 0;
12
+ for (const tag of tags) {
13
+ if (!tag.startsWith(prefix)) continue;
14
+ const suffix = tag.slice(prefix.length);
15
+ if (!/^[1-9]\d{0,15}$/.test(suffix) || !Number.isSafeInteger(Number(suffix))) {
16
+ if (tagsOnly) continue;
17
+ throw new Error("Invalid dev release counter");
18
+ }
19
+ highest = Math.max(highest, Number(suffix));
20
+ }
21
+ return highest;
22
+ }
3
23
  function checkTag(tag) {
4
24
  if (!/^v\d+\.\d+\.\d+(?:-dev\.\d+)?$/.test(tag) || tag.length > 65) throw new Error("Invalid release tag");
5
25
  }
@@ -66,16 +86,16 @@ function createFeedReleaseCutProvider(options) {
66
86
  },
67
87
  pendingBuild: async () => "idle",
68
88
  async highestDevCounter(version) {
69
- if (typeof version !== "string" || version.length > 64 || !/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/.test(version)) throw new Error("Invalid source version");
70
- const prefix = `v${version}-dev.`;
71
- let highest = 0;
72
- for (const tag of [...ledger.releases.map((item) => item.tag), ...created.keys()]) {
73
- if (!tag.startsWith(prefix)) continue;
74
- const suffix = tag.slice(prefix.length);
75
- if (!/^[1-9]\d{0,15}$/.test(suffix) || !Number.isSafeInteger(Number(suffix))) throw new Error("Invalid dev release counter");
76
- highest = Math.max(highest, Number(suffix));
77
- }
78
- return highest;
89
+ checkVersion(version);
90
+ return highestCounter([...ledger.releases.map((item) => item.tag), ...created.keys()], version);
91
+ },
92
+ async highestDevTag(version) {
93
+ checkVersion(version);
94
+ return highestCounter((await git([
95
+ "tag",
96
+ "--list",
97
+ `v${version}-dev.*`
98
+ ])).split("\n").map((line) => line.trim()).filter(Boolean), version, true);
79
99
  },
80
100
  async tagExists(tag) {
81
101
  checkTag(tag);
@@ -62,6 +62,22 @@ function createGitHubReleaseCutProvider(options) {
62
62
  }
63
63
  throw new Error("Release history exceeds inspection limit");
64
64
  },
65
+ async highestDevTag(version) {
66
+ if (typeof version !== "string" || version.length > 64 || !/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/.test(version)) throw new Error("Invalid source version");
67
+ const prefix = `refs/tags/v${version}-dev.`;
68
+ const result = await read(`${base}/git/matching-refs/tags/${encodeURIComponent(`v${version}-dev.`)}`);
69
+ if (!Array.isArray(result) || result.length > 1e5) throw new Error("Invalid tag history");
70
+ let highest = 0;
71
+ for (const value of result) {
72
+ const ref = value?.ref;
73
+ if (typeof ref !== "string") throw new Error("Invalid tag history");
74
+ if (!ref.startsWith(prefix)) continue;
75
+ const suffix = ref.slice(prefix.length);
76
+ if (!/^[1-9]\d{0,15}$/.test(suffix) || !Number.isSafeInteger(Number(suffix))) continue;
77
+ highest = Math.max(highest, Number(suffix));
78
+ }
79
+ return highest;
80
+ },
65
81
  async find(tag) {
66
82
  if (!/^v\d+\.\d+\.\d+(?:-dev\.\d+)?$/.test(tag) || tag.length > 65) throw new Error("Invalid release tag");
67
83
  const kind = tag.includes("-dev.") ? "dev" : "daily";
@@ -6,7 +6,11 @@ export declare function gitCli(): GitRun;
6
6
  export declare function gitIsAncestor(git: GitRun, older: string, newer: string): Promise<boolean>;
7
7
  /** The released version in the source manifest at the exact source commit. */
8
8
  export declare function readSourceVersion(git: GitRun, sourceSha: string, path: string): Promise<string>;
9
- /** The `owner/name` of the checkout's GitHub origin, as descriptors record it. */
9
+ /**
10
+ * The checkout's origin as `owner/name`, as descriptors record it. A GitLab project keeps that
11
+ * two-part form whatever groups it sits in (`adea-ai/ade/adea` is `adea-ai/adea`), so moving forge
12
+ * does not change the identity recorded in new descriptors or in installed apps' feeds.
13
+ */
10
14
  export declare function originRepository(git: GitRun): Promise<string>;
11
15
  /**
12
16
  * Local release provenance, replacing a trusted workflow run: the working tree is a clean
@@ -32,16 +32,23 @@ async function readSourceVersion(git, sourceSha, path) {
32
32
  if (typeof manifest !== "object" || manifest === null || Array.isArray(manifest) || typeof manifest.version !== "string") throw new Error("Invalid source version manifest");
33
33
  return manifest.version;
34
34
  }
35
- /** The `owner/name` of the checkout's GitHub origin, as descriptors record it. */
35
+ /**
36
+ * The checkout's origin as `owner/name`, as descriptors record it. A GitLab project keeps that
37
+ * two-part form whatever groups it sits in (`adea-ai/ade/adea` is `adea-ai/adea`), so moving forge
38
+ * does not change the identity recorded in new descriptors or in installed apps' feeds.
39
+ */
36
40
  async function originRepository(git) {
37
41
  const url = await git([
38
42
  "remote",
39
43
  "get-url",
40
44
  "origin"
41
45
  ]);
42
- const match = /^(?:https:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+?)(?:\.git)?\/?$/.exec(url);
43
- if (!match || match[1].split("/").some((part) => part === "." || part === "..")) throw new Error("Origin is not a GitHub repository");
44
- return match[1];
46
+ const part = "[A-Za-z0-9_.-]+";
47
+ const github = new RegExp(`^(?:https://github\\.com/|git@github\\.com:)(${part}/${part}?)(?:\\.git)?/?$`).exec(url);
48
+ const gitlab = new RegExp(`^(?:https://gitlab\\.com/|git@gitlab\\.com:)(${part})/(?:${part}/)*(${part}?)(?:\\.git)?/?$`).exec(url);
49
+ const repository = github ? github[1] : gitlab ? `${gitlab[1]}/${gitlab[2]}` : void 0;
50
+ if (!repository || repository.split("/").some((segment) => segment === "." || segment === "..")) throw new Error("Origin is not a GitHub or GitLab repository");
51
+ return repository;
45
52
  }
46
53
  /**
47
54
  * Local release provenance, replacing a trusted workflow run: the working tree is a clean
@@ -20,6 +20,10 @@ export type ReleaseCutProvider = {
20
20
  pendingBuild(release: CutRelease): Promise<'pending' | 'idle' | 'unknown'>;
21
21
  /** Inspect all existing dev releases of a dev version line; errors must fail closed. */
22
22
  highestDevCounter(version: string): Promise<number>;
23
+ /** The highest dev counter among the Git tags of a dev version line, with or without a
24
+ * release (0 when none). A tag left by an earlier release system or a deleted release keeps
25
+ * its counter taken, so a new cut numbers above it instead of colliding. */
26
+ highestDevTag(version: string): Promise<number>;
23
27
  /** Check the actual Git tag even when no release exists. */
24
28
  tagExists(tag: string): Promise<boolean>;
25
29
  dispatch(tag: string): Promise<void>;
@@ -39,7 +43,10 @@ export declare function nextDevVersion(released: string): string;
39
43
  * `v<next>-dev.N` for the next unreleased version (see `nextDevVersion`), where N counts
40
44
  * that version's dev releases from 1, so it starts again at 1 when a release moves the
41
45
  * next version: `v0.112.0-dev.15` is followed, after the `v0.112.0` release, by
42
- * `v0.113.0-dev.1`.
46
+ * `v0.113.0-dev.1`. A new cut also numbers above every existing dev tag of the version,
47
+ * so tags with no trusted release (from an earlier release system) are skipped, never
48
+ * reused or moved: with `v0.73.0-dev.1` and `dev.2` tagged but unreleased, the cut is
49
+ * `v0.73.0-dev.3`.
43
50
  */
44
51
  export declare function cutRelease(options: {
45
52
  kind: 'dev' | 'daily';
@@ -18,7 +18,10 @@ function nextDevVersion(released) {
18
18
  * `v<next>-dev.N` for the next unreleased version (see `nextDevVersion`), where N counts
19
19
  * that version's dev releases from 1, so it starts again at 1 when a release moves the
20
20
  * next version: `v0.112.0-dev.15` is followed, after the `v0.112.0` release, by
21
- * `v0.113.0-dev.1`.
21
+ * `v0.113.0-dev.1`. A new cut also numbers above every existing dev tag of the version,
22
+ * so tags with no trusted release (from an earlier release system) are skipped, never
23
+ * reused or moved: with `v0.73.0-dev.1` and `dev.2` tagged but unreleased, the cut is
24
+ * `v0.73.0-dev.3`.
22
25
  */
23
26
  async function cutRelease(options) {
24
27
  const { kind, sourceSha, releasedVersion, provider } = options;
@@ -33,6 +36,11 @@ async function cutRelease(options) {
33
36
  if (highest > 0 && !newest) throw new Error("Dev release history changed");
34
37
  if (newest && newest.sourceSha !== sourceSha && !await provider.isAncestor(newest.sourceSha, sourceSha)) throw new Error("Dev release source is not newer than the last dev release");
35
38
  count = newest?.sourceSha === sourceSha ? highest : highest + 1;
39
+ if (count > highest) {
40
+ const tagged = await provider.highestDevTag(version);
41
+ if (!Number.isSafeInteger(tagged) || tagged < 0) throw new Error("Dev tag history is invalid");
42
+ count = Math.max(count, tagged + 1);
43
+ }
36
44
  }
37
45
  const tag = `v${version}${kind === "dev" ? `-dev.${count}` : ""}`;
38
46
  let release = await provider.find(tag);
@@ -0,0 +1,46 @@
1
+ import { type FeedChannel } from '../updates/release-feed';
2
+ /** An inventory item from an independent, complete object listing. */
3
+ export type RetentionObject = Readonly<{
4
+ key: string;
5
+ version: string;
6
+ size: number;
7
+ sha256: string;
8
+ modifiedAt: string;
9
+ role: 'payload' | 'provenance';
10
+ }>;
11
+ /**
12
+ * Offline evidence for an advisory report. Completeness must be established by the
13
+ * caller; this module does not fetch, authenticate, lock, or delete any object.
14
+ */
15
+ export type RetentionEvidence = Readonly<{
16
+ feed: unknown;
17
+ ledger: unknown;
18
+ releases: readonly unknown[];
19
+ pointers: Readonly<Record<FeedChannel, unknown | null>>;
20
+ objects: readonly RetentionObject[];
21
+ protectedTags: Readonly<{
22
+ rollback: readonly string[];
23
+ qualification: readonly string[];
24
+ promotion: readonly string[];
25
+ inFlight: readonly string[];
26
+ }>;
27
+ /** Latest time each unprotected release could have been exposed to a reader. */
28
+ lastExposedAt: Readonly<Record<string, string>>;
29
+ /** All sources must cover the complete namespace and all reference classes. */
30
+ complete: boolean;
31
+ now: string;
32
+ discoveryGraceMs: number;
33
+ }>;
34
+ /** Advisory only: returned object identities are not a deletion authorization. */
35
+ export declare function planRetentionDryRun(input: RetentionEvidence): {
36
+ mode: 'advisory-only';
37
+ review: Readonly<{
38
+ key: string;
39
+ version: string;
40
+ size: number;
41
+ sha256: string;
42
+ modifiedAt: string;
43
+ role: 'payload' | 'provenance';
44
+ }>[];
45
+ protectedTags: string[];
46
+ };
@@ -0,0 +1,94 @@
1
+ import { feedAssetKey, parseFeedRelease, parseReleaseFeed, parseReleaseLedger } from "../updates/release-feed.js";
2
+ import { versionLessThan } from "../updates/release-version.js";
3
+ // src/release/retention-dry-run.ts
4
+ var DAY = 864e5;
5
+ var channels = [
6
+ "dev",
7
+ "daily",
8
+ "stable"
9
+ ];
10
+ function time(value) {
11
+ const parsed = Date.parse(value);
12
+ if (!Number.isFinite(parsed) || new Date(parsed).toISOString().replace(".000Z", "Z") !== value.replace(".000Z", "Z")) throw new Error("Invalid retention timestamp");
13
+ return parsed;
14
+ }
15
+ /** Advisory only: returned object identities are not a deletion authorization. */
16
+ function planRetentionDryRun(input) {
17
+ if (input.complete !== true) throw new Error("Incomplete retention evidence");
18
+ const feed = parseReleaseFeed(input.feed);
19
+ const ledger = parseReleaseLedger(input.ledger, feed.app);
20
+ const now = time(input.now);
21
+ if (!Number.isSafeInteger(input.discoveryGraceMs) || input.discoveryGraceMs < DAY || input.discoveryGraceMs > 7 * DAY) throw new Error("Invalid discovery grace");
22
+ const releases = new Map(input.releases.map((value) => {
23
+ const release = parseFeedRelease(value);
24
+ return [release.tag, release];
25
+ }));
26
+ if (releases.size !== input.releases.length || releases.size !== ledger.releases.length) throw new Error("Release inventory does not match ledger");
27
+ const protectedTags = /* @__PURE__ */ new Set();
28
+ for (const key of [
29
+ "rollback",
30
+ "qualification",
31
+ "promotion",
32
+ "inFlight"
33
+ ]) {
34
+ const list = input.protectedTags?.[key];
35
+ if (!Array.isArray(list)) throw new Error("Incomplete protection references");
36
+ for (const tag of list) protectedTags.add(tag);
37
+ }
38
+ for (const channel of channels) {
39
+ if (!Object.hasOwn(input.pointers, channel)) throw new Error("Missing channel pointer");
40
+ const value = input.pointers[channel];
41
+ const kinds = channel === "dev" ? ["dev"] : channel === "stable" ? ["stable"] : ["daily", "stable"];
42
+ if (value === null) {
43
+ if (ledger.releases.some((entry) => kinds.includes(entry.kind))) throw new Error("Missing active channel");
44
+ continue;
45
+ }
46
+ const pointer = parseFeedRelease(value);
47
+ const newest = ledger.releases.filter((item) => kinds.includes(item.kind)).reduce((best, item) => !best || versionLessThan(best.tag, item.tag) ? item : best, void 0);
48
+ const release = releases.get(pointer.tag);
49
+ const entry = ledger.releases.find((item) => item.tag === pointer.tag);
50
+ if (!release || !entry || newest?.tag !== pointer.tag || pointer.channel !== channel || !kinds.includes(entry.kind) || pointer.publishedAt !== release.publishedAt || JSON.stringify(pointer.assets) !== JSON.stringify(release.assets) || channel === "stable" && JSON.stringify(pointer.missingPlatforms) !== JSON.stringify(release.missingPlatforms)) throw new Error("Inconsistent channel pointer");
51
+ protectedTags.add(pointer.tag);
52
+ }
53
+ for (const tag of protectedTags) if (!releases.has(tag)) throw new Error("Missing protected release");
54
+ const objects = /* @__PURE__ */ new Map();
55
+ for (const item of input.objects) {
56
+ if (objects.has(item.key) || !["payload", "provenance"].includes(item.role) || typeof item.version !== "string" || !item.version || !Number.isSafeInteger(item.size) || item.size < 1 || !/^[a-f0-9]{64}$/.test(item.sha256) || time(item.modifiedAt) > now) throw new Error("Invalid object identity");
57
+ objects.set(item.key, item);
58
+ }
59
+ const review = [];
60
+ let unprotectedDailyCount = 0;
61
+ for (const entry of ledger.releases) {
62
+ const release = releases.get(entry.tag);
63
+ if (!release || release.channel !== entry.kind || release.publishedAt !== entry.publishedAt) throw new Error("Inconsistent release ledger");
64
+ if (entry.kind === "dev" || entry.kind === "stable") protectedTags.add(entry.tag);
65
+ const releaseTime = Math.max(time(entry.publishedAt), entry.promotedAt ? time(entry.promotedAt) : 0);
66
+ if (releaseTime > now) throw new Error("Future release");
67
+ const releaseObjects = [];
68
+ for (const asset of release.assets) {
69
+ const key = feedAssetKey(feed, entry.tag, asset.name);
70
+ const item = objects.get(key);
71
+ if (!item || item.size !== asset.size || item.sha256 !== asset.sha256) throw new Error("Missing or inconsistent asset identity");
72
+ objects.delete(key);
73
+ releaseObjects.push(item);
74
+ }
75
+ if (!protectedTags.has(entry.tag)) {
76
+ unprotectedDailyCount++;
77
+ const lastChange = Math.max(releaseTime, ...releaseObjects.map((item) => time(item.modifiedAt)));
78
+ if (!input.lastExposedAt || !Object.hasOwn(input.lastExposedAt, entry.tag)) throw new Error("Missing last-exposure evidence");
79
+ const exposure = input.lastExposedAt[entry.tag];
80
+ if (typeof exposure !== "string") throw new Error("Missing last-exposure evidence");
81
+ const lastExposed = time(exposure);
82
+ if (lastExposed < releaseTime || lastExposed > now) throw new Error("Invalid last-exposure evidence");
83
+ const age = now - lastChange;
84
+ if (age >= input.discoveryGraceMs && now - lastExposed >= input.discoveryGraceMs && (age >= 7 * DAY || unprotectedDailyCount > 20)) review.push(...releaseObjects.filter((item) => item.role === "payload").map((item) => ({ ...item })));
85
+ }
86
+ }
87
+ if (objects.size) throw new Error("Unaccounted release asset");
88
+ return {
89
+ mode: "advisory-only",
90
+ review,
91
+ protectedTags: [...protectedTags].toSorted()
92
+ };
93
+ }
94
+ export { planRetentionDryRun };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/app-framework",
3
- "version": "0.28.0",
3
+ "version": "0.28.2",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",