Repair packed agent startup and bound activation metadata retention

This commit is contained in:
Timothy J. Aveni
2026-10-08 11:19:19 -07:00
parent ffd728b061
commit 165510341d
3 changed files with 93 additions and 21 deletions
+5 -1
View File
@@ -9,7 +9,11 @@ export class CandidateMetadataBudget {
private bytes = 0;
private scopes = 0;
private readonly owners = new Map<string, number>();
constructor(limits = { bytes: 512 * 1024 * 1024, ownerBytes: 256 * 1024 * 1024, candidates: 128 }) {
// A cutover holds both the serving and proposed installation plus transient
// parsing space. The 57-repository reader retains ~133 MiB per installation;
// a 256 MiB owner ceiling cannot admit its ordinary atomic replacement.
// Keep the aggregate ceiling independent and leave room for parsing overlap.
constructor(limits = { bytes: 512 * 1024 * 1024, ownerBytes: 384 * 1024 * 1024, candidates: 128 }) {
for (const value of Object.values(limits))
if (!Number.isSafeInteger(value) || value < 1) throw Error("INVALID_CANDIDATE_METADATA_BUDGET");
if (limits.ownerBytes > limits.bytes) throw Error("INVALID_CANDIDATE_METADATA_BUDGET");