dsh-charter 0.2.1 → 0.2.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.
- package/CHANGELOG.md +32 -1
- package/CHANGELOG.zh.md +25 -1
- package/README.md +37 -21
- package/README.zh.md +27 -17
- package/docs/README.md +5 -2
- package/docs/README.zh.md +3 -2
- package/docs/assets/charter-pane.zh.png +0 -0
- package/docs/design/charter-dependency-graph-v1.zh.md +1101 -0
- package/docs/design/charter-workspace-v2.zh.md +16 -0
- package/docs/design/version-roadmap.md +2 -3
- package/docs/design/version-roadmap.zh.md +14 -4
- package/docs/release-notes/0.2.1.md +8 -6
- package/docs/release-notes/0.2.2.md +60 -0
- package/docs/release-notes/README.md +1 -2
- package/docs/releasing.md +4 -6
- package/docs/releasing.zh.md +4 -6
- package/docs/user-guide.md +36 -15
- package/docs/user-guide.zh.md +34 -13
- package/docs/verification.md +35 -29
- package/docs/verification.zh.md +30 -25
- package/lib/client/DependencyGraph.d.ts +19 -0
- package/lib/client/locales.d.ts +62 -6
- package/lib/client/relation-graph.d.ts +135 -0
- package/lib/client.js +1829 -206
- package/lib/core/change-set.d.ts +7 -0
- package/lib/core/dependencies.d.ts +29 -0
- package/lib/core.js +1 -1
- package/lib/{fork-D5HVDV1i.js → fork-KSL6sovw.js} +70 -1
- package/lib/host/types.d.ts +2 -0
- package/lib/index.js +2 -2
- package/lib/remote/wire.d.ts +37 -3
- package/lib/remote.js +23 -3
- package/lib/{service-CNjnvioR.js → service-MsIACddZ.js} +6 -3
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/core/change-set.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { applyOps, type ApplyOpsInput } from './commands.js';
|
|
2
|
+
import { type DependencyConflictDiff } from './dependencies.js';
|
|
2
3
|
import type { CharterEditRequest, CharterOp } from './schemas.js';
|
|
3
4
|
export interface ChangeSetSide {
|
|
4
5
|
readonly revision: number;
|
|
@@ -15,6 +16,12 @@ export interface PlannedChangeSet {
|
|
|
15
16
|
readonly summaryDigest: `sha256:${string}`;
|
|
16
17
|
readonly promptChanged: boolean;
|
|
17
18
|
readonly metadataOnly: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Design §6.5: readiness conflicts this Change Set introduces or worsens.
|
|
21
|
+
* Deliberately NOT part of `summaryDigest` (which binds revisions, prompt
|
|
22
|
+
* digests and changes) so adding it cannot invalidate an existing preview.
|
|
23
|
+
*/
|
|
24
|
+
readonly dependencyConflicts: DependencyConflictDiff;
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
27
|
* Canonical client-side Change Set projection. The Host remains the authority;
|
|
@@ -21,3 +21,32 @@ export declare function validateDependencyGraph(items: readonly CharterItem[]):
|
|
|
21
21
|
export declare function prerequisiteStatus(item: DeliverableItem, items: readonly CharterItem[]): PrerequisiteStatus;
|
|
22
22
|
export declare function executionDisplay(item: DeliverableItem, items: readonly CharterItem[]): ExecutionDisplay;
|
|
23
23
|
export declare function dependencyProjection(items: readonly CharterItem[]): readonly DependencyProjection[];
|
|
24
|
+
/**
|
|
25
|
+
* Prerequisite ids that make `item` conflict right now: a cancelled prerequisite,
|
|
26
|
+
* or a prerequisite that is not `done` while the dependent already started.
|
|
27
|
+
* Mirrors `prerequisiteStatus` rules 1–2, but returns the causes so a Change Set
|
|
28
|
+
* can tell "new conflict" from "worsened conflict".
|
|
29
|
+
*/
|
|
30
|
+
export declare function conflictingPrerequisites(item: DeliverableItem, items: readonly CharterItem[]): readonly string[];
|
|
31
|
+
export interface DependencyConflictRef {
|
|
32
|
+
readonly itemId: string;
|
|
33
|
+
/** `absent` when the item was not an active deliverable before this Change Set. */
|
|
34
|
+
readonly before: PrerequisiteStatus | 'absent';
|
|
35
|
+
readonly after: PrerequisiteStatus;
|
|
36
|
+
readonly beforeConflicts: number;
|
|
37
|
+
readonly afterConflicts: number;
|
|
38
|
+
}
|
|
39
|
+
export interface DependencyConflictDiff {
|
|
40
|
+
readonly added: readonly DependencyConflictRef[];
|
|
41
|
+
readonly worsened: readonly DependencyConflictRef[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Design §6.5: a Change Set must prominently mark newly introduced or worsened
|
|
45
|
+
* readiness conflicts and require explicit user confirmation. This is the shared
|
|
46
|
+
* before/after comparison used by the planner (Host authority) and the Pane
|
|
47
|
+
* (immediate feedback), so both sides cannot drift.
|
|
48
|
+
*
|
|
49
|
+
* Structural illegality (cycles, dangling or inactive endpoints) is *not* part of
|
|
50
|
+
* this diff: `validateDependencyGraph` rejects those outright.
|
|
51
|
+
*/
|
|
52
|
+
export declare function dependencyConflictDiff(before: readonly CharterItem[], after: readonly CharterItem[]): DependencyConflictDiff;
|
package/lib/core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as charterItemSchema, $t as recordMaintenanceAvailable, At as proposalSourceSchema, Bt as sha256Json, C as buildRecordArchive, Ct as mutationIdSchema, D as validateArchiveEnvelope, Dt as proposalBatchSchema, E as recordDigestOf, Et as objectiveProposalSchema, F as buildSnapshotUnchecked, Ft as compareCodeUnits, G as CHARTER_RECORD_SCHEMA_VERSION, Gt as DEFAULT_CHARTER_LIMITS, H as inspectUserText, I as emptySnapshot, It as compareOrderedItems, J as charterChangeSchema, Jt as MIN_RECORD_BYTES, K as charterActorSchema, Kt as MIN_HISTORY_BYTES, L as assertStateQuota, Lt as isDeliverable, Mt as encodePromptText, N as applyOps, Nt as renderCharterPrompt, O as withPayloadDigest, Ot as proposalCandidateRefSchema, P as buildSnapshot, Pt as canonicalItems, Q as charterInitializeRequestSchema, Qt as jsonBytes, R as validateState, Rt as isInvariant, S as assertRestorableArchive, St as maintenanceKindSchema, T as payloadDigestOf, Tt as newItemInputSchema, U as normalizeEditRequest, Ut as bootstrapFromEvents, V as clientRefsOf, Vt as sha256Text, W as normalizeUserText, Wt as bootstrapFromSummary, X as charterEvidenceSchema, Xt as RECOVERY_HEADROOM, Y as charterEditRequestSchema, Yt as RECOVERY_HARD_CEILING, Z as charterIdentitySchema, Zt as clampCharterLimits, _ as migrateRecordV1ToV2, _t as deliverableProgressSchema, a as appendMaintenanceReceipt, at as charterRecordArchiveSchema, b as assertArchiveAdmission, bt as invariantInputSchema, c as assertRecoveryRecordAdmission, ct as charterRecordV1Schema, d as createEmptyRecord, dt as charterSnapshotSchema, en as recoveryWithinBudget, et as charterLifecycleSchema, f as emptyStateDigest, ft as charterValiditySchema, g as maintenanceRequestDigestOf, gt as deliverableItemSchema, h as legacyValidityFor, ht as deliverableInputSchema, i as RevisionConflict, it as charterReceiptSchema, jt as CHARTER_PROMPT_PREFIX, kt as proposalSourceKindSchema, l as assertSnapshotAdmission, lt as charterRestoreRequestSchema, m as isRecordOverBudget, mt as clientRefSchema, n as MAX_PROPOSAL_BATCHES, nn as CharterError, nt as charterObjectiveSchema, o as assertRecordAdmission, ot as charterRecordArchiveSourceSchema, p as isExpectedControlError, pt as charterVerificationSchema, q as charterBootstrapApplyRequestSchema, qt as MIN_PROMPT_BYTES, r as MutationReplay, rn as charterError, rt as charterOpSchema, s as assertRecordConsistency, st as charterRecordSchema, t as forkRecord, tn as utf8Bytes, tt as charterMaintenanceReceiptSchema, u as commitRecord, ut as charterReviewSchema, v as requestDigestOf, vt as digestSchema, w as maintenanceSemanticCheck, wt as mutationReceiptSchema, x as assertRecoveryRequestAdmission, xt as invariantItemSchema, y as restoredRecord, yt as identifierSchema, zt as isStandingItem } from "./fork-KSL6sovw.js";
|
|
2
2
|
export { CHARTER_PROMPT_PREFIX, CHARTER_RECORD_SCHEMA_VERSION, CharterError, DEFAULT_CHARTER_LIMITS, MAX_PROPOSAL_BATCHES, MIN_HISTORY_BYTES, MIN_PROMPT_BYTES, MIN_RECORD_BYTES, MutationReplay, RECOVERY_HARD_CEILING, RECOVERY_HEADROOM, RevisionConflict, appendMaintenanceReceipt, applyOps, assertArchiveAdmission, assertRecordAdmission, assertRecordConsistency, assertRecoveryRecordAdmission, assertRecoveryRequestAdmission, assertRestorableArchive, assertSnapshotAdmission, assertStateQuota, bootstrapFromEvents, bootstrapFromSummary, buildRecordArchive, buildSnapshot, buildSnapshotUnchecked, canonicalItems, charterActorSchema, charterBootstrapApplyRequestSchema, charterChangeSchema, charterEditRequestSchema, charterError, charterEvidenceSchema, charterIdentitySchema, charterInitializeRequestSchema, charterItemSchema, charterLifecycleSchema, charterMaintenanceReceiptSchema, charterObjectiveSchema, charterOpSchema, charterReceiptSchema, charterRecordArchiveSchema, charterRecordArchiveSourceSchema, charterRecordSchema, charterRecordV1Schema, charterRestoreRequestSchema, charterReviewSchema, charterSnapshotSchema, charterValiditySchema, charterVerificationSchema, clampCharterLimits, clientRefSchema, clientRefsOf, commitRecord, compareCodeUnits, compareOrderedItems as compareItems, createEmptyRecord, deliverableInputSchema, deliverableItemSchema, deliverableProgressSchema, digestSchema, emptySnapshot, emptyStateDigest, encodePromptText, forkRecord, identifierSchema, inspectUserText, invariantInputSchema, invariantItemSchema, isDeliverable, isExpectedControlError, isInvariant, isRecordOverBudget, isStandingItem, jsonBytes, legacyValidityFor, maintenanceKindSchema, maintenanceRequestDigestOf, maintenanceSemanticCheck, migrateRecordV1ToV2, mutationIdSchema, mutationReceiptSchema, newItemInputSchema, normalizeEditRequest, normalizeUserText, objectiveProposalSchema, payloadDigestOf, proposalBatchSchema, proposalCandidateRefSchema, proposalSourceKindSchema, proposalSourceSchema, recordDigestOf, recordMaintenanceAvailable, recoveryWithinBudget, renderCharterPrompt, renderCharterPrompt as renderPrompt, requestDigestOf, restoredRecord, sha256Json, sha256Text, utf8Bytes, validateArchiveEnvelope, validateState, withPayloadDigest };
|
|
@@ -1241,6 +1241,75 @@ function dependencyProjection(items) {
|
|
|
1241
1241
|
executionDisplay: executionDisplay(item, items)
|
|
1242
1242
|
}));
|
|
1243
1243
|
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Prerequisite ids that make `item` conflict right now: a cancelled prerequisite,
|
|
1246
|
+
* or a prerequisite that is not `done` while the dependent already started.
|
|
1247
|
+
* Mirrors `prerequisiteStatus` rules 1–2, but returns the causes so a Change Set
|
|
1248
|
+
* can tell "new conflict" from "worsened conflict".
|
|
1249
|
+
*/
|
|
1250
|
+
function conflictingPrerequisites(item, items) {
|
|
1251
|
+
const byId = new Map(items.map((candidate) => [candidate.id, candidate]));
|
|
1252
|
+
const causes = [];
|
|
1253
|
+
for (const id of item.requires ?? []) {
|
|
1254
|
+
const prerequisite = byId.get(id);
|
|
1255
|
+
if (prerequisite === void 0 || prerequisite.kind !== "deliverable") continue;
|
|
1256
|
+
if (prerequisite.progress === "cancelled") {
|
|
1257
|
+
causes.push(id);
|
|
1258
|
+
continue;
|
|
1259
|
+
}
|
|
1260
|
+
if (prerequisite.progress !== "done" && (item.progress === "in-progress" || item.progress === "done")) causes.push(id);
|
|
1261
|
+
}
|
|
1262
|
+
return causes;
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Design §6.5: a Change Set must prominently mark newly introduced or worsened
|
|
1266
|
+
* readiness conflicts and require explicit user confirmation. This is the shared
|
|
1267
|
+
* before/after comparison used by the planner (Host authority) and the Pane
|
|
1268
|
+
* (immediate feedback), so both sides cannot drift.
|
|
1269
|
+
*
|
|
1270
|
+
* Structural illegality (cycles, dangling or inactive endpoints) is *not* part of
|
|
1271
|
+
* this diff: `validateDependencyGraph` rejects those outright.
|
|
1272
|
+
*/
|
|
1273
|
+
function dependencyConflictDiff(before, after) {
|
|
1274
|
+
const snapshot = (items) => {
|
|
1275
|
+
const out = /* @__PURE__ */ new Map();
|
|
1276
|
+
for (const item of standingDeliverables(items)) out.set(item.id, {
|
|
1277
|
+
status: prerequisiteStatus(item, items),
|
|
1278
|
+
conflicts: conflictingPrerequisites(item, items).length
|
|
1279
|
+
});
|
|
1280
|
+
return out;
|
|
1281
|
+
};
|
|
1282
|
+
const beforeState = snapshot(before);
|
|
1283
|
+
const afterState = snapshot(after);
|
|
1284
|
+
const added = [];
|
|
1285
|
+
const worsened = [];
|
|
1286
|
+
for (const [itemId, next] of afterState) {
|
|
1287
|
+
if (next.status !== "dependency-conflict") continue;
|
|
1288
|
+
const previous = beforeState.get(itemId);
|
|
1289
|
+
if (previous === void 0 || previous.status !== "dependency-conflict") {
|
|
1290
|
+
added.push({
|
|
1291
|
+
itemId,
|
|
1292
|
+
before: previous?.status ?? "absent",
|
|
1293
|
+
after: next.status,
|
|
1294
|
+
beforeConflicts: previous?.conflicts ?? 0,
|
|
1295
|
+
afterConflicts: next.conflicts
|
|
1296
|
+
});
|
|
1297
|
+
continue;
|
|
1298
|
+
}
|
|
1299
|
+
if (next.conflicts > previous.conflicts) worsened.push({
|
|
1300
|
+
itemId,
|
|
1301
|
+
before: previous.status,
|
|
1302
|
+
after: next.status,
|
|
1303
|
+
beforeConflicts: previous.conflicts,
|
|
1304
|
+
afterConflicts: next.conflicts
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
const byItemId = (left, right) => left.itemId < right.itemId ? -1 : left.itemId > right.itemId ? 1 : 0;
|
|
1308
|
+
return {
|
|
1309
|
+
added: added.sort(byItemId),
|
|
1310
|
+
worsened: worsened.sort(byItemId)
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1244
1313
|
//#endregion
|
|
1245
1314
|
//#region .build-ts/core/state.js
|
|
1246
1315
|
function assertCanonicalText(value, field) {
|
|
@@ -2665,4 +2734,4 @@ function forkRecord(input) {
|
|
|
2665
2734
|
return child;
|
|
2666
2735
|
}
|
|
2667
2736
|
//#endregion
|
|
2668
|
-
export {
|
|
2737
|
+
export { charterItemSchema as $, recordMaintenanceAvailable as $t, compactionProjectionDigest as A, proposalSourceSchema as At, dependencyProjection as B, sha256Json as Bt, buildRecordArchive as C, mutationIdSchema as Ct, validateArchiveEnvelope as D, proposalBatchSchema as Dt, recordDigestOf as E, objectiveProposalSchema as Et, buildSnapshotUnchecked as F, compareCodeUnits as Ft, CHARTER_RECORD_SCHEMA_VERSION as G, DEFAULT_CHARTER_LIMITS as Gt, inspectUserText as H, assertEditAuthorized as Ht, emptySnapshot as I, compareOrderedItems as It, charterChangeSchema as J, MIN_RECORD_BYTES as Jt, charterActorSchema as K, MIN_HISTORY_BYTES as Kt, assertStateQuota as L, isDeliverable$1 as Lt, verifySourceProjection as M, encodePromptText as Mt, applyOps as N, renderCharterPrompt as Nt, withPayloadDigest as O, proposalCandidateRefSchema as Ot, buildSnapshot as P, canonicalItems as Pt, charterInitializeRequestSchema as Q, jsonBytes as Qt, validateState as R, isInvariant$1 as Rt, assertRestorableArchive as S, maintenanceKindSchema as St, payloadDigestOf as T, newItemInputSchema as Tt, normalizeEditRequest as U, bootstrapFromEvents as Ut, clientRefsOf as V, sha256Text as Vt, normalizeUserText as W, bootstrapFromSummary as Wt, charterEvidenceSchema as X, RECOVERY_HEADROOM as Xt, charterEditRequestSchema as Y, RECOVERY_HARD_CEILING as Yt, charterIdentitySchema as Z, clampCharterLimits as Zt, migrateRecordV1ToV2 as _, deliverableProgressSchema as _t, appendMaintenanceReceipt as a, charterRecordArchiveSchema as at, assertArchiveAdmission as b, invariantInputSchema as bt, assertRecoveryRecordAdmission as c, charterRecordV1Schema as ct, createEmptyRecord as d, charterSnapshotSchema as dt, recoveryWithinBudget as en, charterLifecycleSchema as et, emptyStateDigest as f, charterValiditySchema as ft, maintenanceRequestDigestOf as g, deliverableItemSchema as gt, legacyValidityFor as h, deliverableInputSchema as ht, RevisionConflict as i, charterReceiptSchema as it, messageProjectionDigest as j, CHARTER_PROMPT_PREFIX as jt, agentProjectionDigest as k, proposalSourceKindSchema as kt, assertSnapshotAdmission as l, charterRestoreRequestSchema as lt, isRecordOverBudget as m, clientRefSchema as mt, MAX_PROPOSAL_BATCHES as n, CharterError as nn, charterObjectiveSchema as nt, assertRecordAdmission as o, charterRecordArchiveSourceSchema as ot, isExpectedControlError as p, charterVerificationSchema as pt, charterBootstrapApplyRequestSchema as q, MIN_PROMPT_BYTES as qt, MutationReplay as r, charterError as rn, charterOpSchema as rt, assertRecordConsistency as s, charterRecordSchema as st, forkRecord as t, utf8Bytes as tn, charterMaintenanceReceiptSchema as tt, commitRecord as u, charterReviewSchema as ut, requestDigestOf as v, digestSchema as vt, maintenanceSemanticCheck as w, mutationReceiptSchema as wt, assertRecoveryRequestAdmission as x, invariantItemSchema as xt, restoredRecord as y, identifierSchema as yt, dependencyConflictDiff as z, isStandingItem as zt };
|
package/lib/host/types.d.ts
CHANGED
|
@@ -400,6 +400,8 @@ export type CharterChangeSetPreviewResult = {
|
|
|
400
400
|
readonly changes: readonly import('../core/schemas.js').CharterChange[];
|
|
401
401
|
readonly promptChanged: boolean;
|
|
402
402
|
readonly metadataOnly: boolean;
|
|
403
|
+
/** Optional so a Host predating §6.5 still decodes; absent means "not reported". */
|
|
404
|
+
readonly dependencyConflicts?: import('../core/dependencies.js').DependencyConflictDiff;
|
|
403
405
|
} | {
|
|
404
406
|
readonly ok: false;
|
|
405
407
|
readonly code: CharterErrorCode;
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { a as CHARTER_DOMAIN_NAME, n as Config, o as CHARTER_DOMAIN_VERSION, r as DEFAULT_CHARTER_CONFIG, s as charterDomainSpec, t as CharterService } from "./service-
|
|
1
|
+
import { $ as charterItemSchema, $t as recordMaintenanceAvailable, At as proposalSourceSchema, Bt as sha256Json, C as buildRecordArchive, Ct as mutationIdSchema, D as validateArchiveEnvelope, Dt as proposalBatchSchema, E as recordDigestOf, Et as objectiveProposalSchema, F as buildSnapshotUnchecked, Ft as compareCodeUnits, G as CHARTER_RECORD_SCHEMA_VERSION, Gt as DEFAULT_CHARTER_LIMITS, H as inspectUserText, I as emptySnapshot, It as compareOrderedItems, J as charterChangeSchema, Jt as MIN_RECORD_BYTES, K as charterActorSchema, Kt as MIN_HISTORY_BYTES, L as assertStateQuota, Lt as isDeliverable, Mt as encodePromptText, N as applyOps, Nt as renderCharterPrompt, O as withPayloadDigest, Ot as proposalCandidateRefSchema, P as buildSnapshot, Pt as canonicalItems, Q as charterInitializeRequestSchema, Qt as jsonBytes, R as validateState, Rt as isInvariant, S as assertRestorableArchive, St as maintenanceKindSchema, T as payloadDigestOf, Tt as newItemInputSchema, U as normalizeEditRequest, Ut as bootstrapFromEvents, V as clientRefsOf, Vt as sha256Text, W as normalizeUserText, Wt as bootstrapFromSummary, X as charterEvidenceSchema, Xt as RECOVERY_HEADROOM, Y as charterEditRequestSchema, Yt as RECOVERY_HARD_CEILING, Z as charterIdentitySchema, Zt as clampCharterLimits, _ as migrateRecordV1ToV2, _t as deliverableProgressSchema, a as appendMaintenanceReceipt, at as charterRecordArchiveSchema, b as assertArchiveAdmission, bt as invariantInputSchema, c as assertRecoveryRecordAdmission, ct as charterRecordV1Schema, d as createEmptyRecord, dt as charterSnapshotSchema, en as recoveryWithinBudget, et as charterLifecycleSchema, f as emptyStateDigest, ft as charterValiditySchema, g as maintenanceRequestDigestOf, gt as deliverableItemSchema, h as legacyValidityFor, ht as deliverableInputSchema, i as RevisionConflict, it as charterReceiptSchema, jt as CHARTER_PROMPT_PREFIX, kt as proposalSourceKindSchema, l as assertSnapshotAdmission, lt as charterRestoreRequestSchema, m as isRecordOverBudget, mt as clientRefSchema, n as MAX_PROPOSAL_BATCHES, nn as CharterError, nt as charterObjectiveSchema, o as assertRecordAdmission, ot as charterRecordArchiveSourceSchema, p as isExpectedControlError, pt as charterVerificationSchema, q as charterBootstrapApplyRequestSchema, qt as MIN_PROMPT_BYTES, r as MutationReplay, rn as charterError, rt as charterOpSchema, s as assertRecordConsistency, st as charterRecordSchema, t as forkRecord, tn as utf8Bytes, tt as charterMaintenanceReceiptSchema, u as commitRecord, ut as charterReviewSchema, v as requestDigestOf, vt as digestSchema, w as maintenanceSemanticCheck, wt as mutationReceiptSchema, x as assertRecoveryRequestAdmission, xt as invariantItemSchema, y as restoredRecord, yt as identifierSchema, zt as isStandingItem } from "./fork-KSL6sovw.js";
|
|
2
|
+
import { a as CHARTER_DOMAIN_NAME, n as Config, o as CHARTER_DOMAIN_VERSION, r as DEFAULT_CHARTER_CONFIG, s as charterDomainSpec, t as CharterService } from "./service-MsIACddZ.js";
|
|
3
3
|
import "./core.js";
|
|
4
4
|
export { CHARTER_DOMAIN_NAME, CHARTER_DOMAIN_VERSION, CHARTER_PROMPT_PREFIX, CHARTER_RECORD_SCHEMA_VERSION, CharterError, CharterService, CharterService as default, Config, DEFAULT_CHARTER_CONFIG, DEFAULT_CHARTER_LIMITS, MAX_PROPOSAL_BATCHES, MIN_HISTORY_BYTES, MIN_PROMPT_BYTES, MIN_RECORD_BYTES, MutationReplay, RECOVERY_HARD_CEILING, RECOVERY_HEADROOM, RevisionConflict, appendMaintenanceReceipt, applyOps, assertArchiveAdmission, assertRecordAdmission, assertRecordConsistency, assertRecoveryRecordAdmission, assertRecoveryRequestAdmission, assertRestorableArchive, assertSnapshotAdmission, assertStateQuota, bootstrapFromEvents, bootstrapFromSummary, buildRecordArchive, buildSnapshot, buildSnapshotUnchecked, canonicalItems, charterActorSchema, charterBootstrapApplyRequestSchema, charterChangeSchema, charterDomainSpec, charterEditRequestSchema, charterError, charterEvidenceSchema, charterIdentitySchema, charterInitializeRequestSchema, charterItemSchema, charterLifecycleSchema, charterMaintenanceReceiptSchema, charterObjectiveSchema, charterOpSchema, charterReceiptSchema, charterRecordArchiveSchema, charterRecordArchiveSourceSchema, charterRecordSchema, charterRecordV1Schema, charterRestoreRequestSchema, charterReviewSchema, charterSnapshotSchema, charterValiditySchema, charterVerificationSchema, clampCharterLimits, clientRefSchema, clientRefsOf, commitRecord, compareCodeUnits, compareOrderedItems as compareItems, createEmptyRecord, deliverableInputSchema, deliverableItemSchema, deliverableProgressSchema, digestSchema, emptySnapshot, emptyStateDigest, encodePromptText, forkRecord, identifierSchema, inspectUserText, invariantInputSchema, invariantItemSchema, isDeliverable, isExpectedControlError, isInvariant, isRecordOverBudget, isStandingItem, jsonBytes, legacyValidityFor, maintenanceKindSchema, maintenanceRequestDigestOf, maintenanceSemanticCheck, migrateRecordV1ToV2, mutationIdSchema, mutationReceiptSchema, newItemInputSchema, normalizeEditRequest, normalizeUserText, objectiveProposalSchema, payloadDigestOf, proposalBatchSchema, proposalCandidateRefSchema, proposalSourceKindSchema, proposalSourceSchema, recordDigestOf, recordMaintenanceAvailable, recoveryWithinBudget, renderCharterPrompt, renderCharterPrompt as renderPrompt, requestDigestOf, restoredRecord, sha256Json, sha256Text, utf8Bytes, validateArchiveEnvelope, validateState, withPayloadDigest };
|
package/lib/remote/wire.d.ts
CHANGED
|
@@ -489,8 +489,8 @@ export declare const charterSummarySchema: z.ZodObject<{
|
|
|
489
489
|
unknown: "unknown";
|
|
490
490
|
invalid: "invalid";
|
|
491
491
|
healthy: "healthy";
|
|
492
|
-
"write-uncertain": "write-uncertain";
|
|
493
492
|
absent: "absent";
|
|
493
|
+
"write-uncertain": "write-uncertain";
|
|
494
494
|
}>;
|
|
495
495
|
capabilities: z.ZodObject<{
|
|
496
496
|
recordMaintenance: z.ZodBoolean;
|
|
@@ -592,8 +592,8 @@ export declare const charterSummaryFrameSchema: z.ZodUnion<readonly [z.ZodObject
|
|
|
592
592
|
unknown: "unknown";
|
|
593
593
|
invalid: "invalid";
|
|
594
594
|
healthy: "healthy";
|
|
595
|
-
"write-uncertain": "write-uncertain";
|
|
596
595
|
absent: "absent";
|
|
596
|
+
"write-uncertain": "write-uncertain";
|
|
597
597
|
}>;
|
|
598
598
|
capabilities: z.ZodObject<{
|
|
599
599
|
recordMaintenance: z.ZodBoolean;
|
|
@@ -695,8 +695,8 @@ export declare const charterSummaryFrameSchema: z.ZodUnion<readonly [z.ZodObject
|
|
|
695
695
|
unknown: "unknown";
|
|
696
696
|
invalid: "invalid";
|
|
697
697
|
healthy: "healthy";
|
|
698
|
-
"write-uncertain": "write-uncertain";
|
|
699
698
|
absent: "absent";
|
|
699
|
+
"write-uncertain": "write-uncertain";
|
|
700
700
|
}>;
|
|
701
701
|
capabilities: z.ZodObject<{
|
|
702
702
|
recordMaintenance: z.ZodBoolean;
|
|
@@ -1551,6 +1551,40 @@ export declare const charterChangeSetPreviewResultSchema: z.ZodDiscriminatedUnio
|
|
|
1551
1551
|
}, z.core.$strict>], "type">>;
|
|
1552
1552
|
promptChanged: z.ZodBoolean;
|
|
1553
1553
|
metadataOnly: z.ZodBoolean;
|
|
1554
|
+
dependencyConflicts: z.ZodOptional<z.ZodObject<{
|
|
1555
|
+
added: z.ZodArray<z.ZodObject<{
|
|
1556
|
+
itemId: z.ZodString;
|
|
1557
|
+
before: z.ZodEnum<{
|
|
1558
|
+
satisfied: "satisfied";
|
|
1559
|
+
waiting: "waiting";
|
|
1560
|
+
"dependency-conflict": "dependency-conflict";
|
|
1561
|
+
absent: "absent";
|
|
1562
|
+
}>;
|
|
1563
|
+
after: z.ZodEnum<{
|
|
1564
|
+
satisfied: "satisfied";
|
|
1565
|
+
waiting: "waiting";
|
|
1566
|
+
"dependency-conflict": "dependency-conflict";
|
|
1567
|
+
}>;
|
|
1568
|
+
beforeConflicts: z.ZodNumber;
|
|
1569
|
+
afterConflicts: z.ZodNumber;
|
|
1570
|
+
}, z.core.$strict>>;
|
|
1571
|
+
worsened: z.ZodArray<z.ZodObject<{
|
|
1572
|
+
itemId: z.ZodString;
|
|
1573
|
+
before: z.ZodEnum<{
|
|
1574
|
+
satisfied: "satisfied";
|
|
1575
|
+
waiting: "waiting";
|
|
1576
|
+
"dependency-conflict": "dependency-conflict";
|
|
1577
|
+
absent: "absent";
|
|
1578
|
+
}>;
|
|
1579
|
+
after: z.ZodEnum<{
|
|
1580
|
+
satisfied: "satisfied";
|
|
1581
|
+
waiting: "waiting";
|
|
1582
|
+
"dependency-conflict": "dependency-conflict";
|
|
1583
|
+
}>;
|
|
1584
|
+
beforeConflicts: z.ZodNumber;
|
|
1585
|
+
afterConflicts: z.ZodNumber;
|
|
1586
|
+
}, z.core.$strict>>;
|
|
1587
|
+
}, z.core.$strict>>;
|
|
1554
1588
|
}, z.core.$strict>, z.ZodObject<{
|
|
1555
1589
|
ok: z.ZodLiteral<false>;
|
|
1556
1590
|
code: z.ZodEnum<{
|
package/lib/remote.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as peerPrincipalRequired, i as resolveActor, l as remoteMethod } from "./service-
|
|
1
|
+
import { $ as charterItemSchema, Et as objectiveProposalSchema, J as charterChangeSchema, K as charterActorSchema, Ot as proposalCandidateRefSchema, Q as charterInitializeRequestSchema, Y as charterEditRequestSchema, at as charterRecordArchiveSchema, lt as charterRestoreRequestSchema, nn as CharterError, nt as charterObjectiveSchema, q as charterBootstrapApplyRequestSchema } from "./fork-KSL6sovw.js";
|
|
2
|
+
import { c as peerPrincipalRequired, i as resolveActor, l as remoteMethod } from "./service-MsIACddZ.js";
|
|
3
3
|
import "@deepseek-ai/cordis";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
@@ -1141,6 +1141,22 @@ const charterValidatorRunResultSchema = z.discriminatedUnion("ok", [z.object({
|
|
|
1141
1141
|
code: charterErrorCodeSchema,
|
|
1142
1142
|
message: z.string()
|
|
1143
1143
|
}).strict()]);
|
|
1144
|
+
const charterDependencyConflictRefSchema = z.object({
|
|
1145
|
+
itemId: z.string(),
|
|
1146
|
+
before: z.enum([
|
|
1147
|
+
"satisfied",
|
|
1148
|
+
"waiting",
|
|
1149
|
+
"dependency-conflict",
|
|
1150
|
+
"absent"
|
|
1151
|
+
]),
|
|
1152
|
+
after: z.enum([
|
|
1153
|
+
"satisfied",
|
|
1154
|
+
"waiting",
|
|
1155
|
+
"dependency-conflict"
|
|
1156
|
+
]),
|
|
1157
|
+
beforeConflicts: z.number().int().nonnegative(),
|
|
1158
|
+
afterConflicts: z.number().int().nonnegative()
|
|
1159
|
+
}).strict();
|
|
1144
1160
|
const charterChangeSetPreviewResultSchema = z.discriminatedUnion("ok", [z.object({
|
|
1145
1161
|
ok: z.literal(true),
|
|
1146
1162
|
previewDigest: z.string(),
|
|
@@ -1158,7 +1174,11 @@ const charterChangeSetPreviewResultSchema = z.discriminatedUnion("ok", [z.object
|
|
|
1158
1174
|
}).strict(),
|
|
1159
1175
|
changes: z.array(charterChangeSchema),
|
|
1160
1176
|
promptChanged: z.boolean(),
|
|
1161
|
-
metadataOnly: z.boolean()
|
|
1177
|
+
metadataOnly: z.boolean(),
|
|
1178
|
+
dependencyConflicts: z.object({
|
|
1179
|
+
added: z.array(charterDependencyConflictRefSchema),
|
|
1180
|
+
worsened: z.array(charterDependencyConflictRefSchema)
|
|
1181
|
+
}).strict().optional()
|
|
1162
1182
|
}).strict(), z.object({
|
|
1163
1183
|
ok: z.literal(false),
|
|
1164
1184
|
code: charterErrorCodeSchema,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as compactionProjectionDigest, B as
|
|
1
|
+
import { $t as recordMaintenanceAvailable, A as compactionProjectionDigest, B as dependencyProjection, Bt as sha256Json, C as buildRecordArchive, D as validateArchiveEnvelope, E as recordDigestOf, Gt as DEFAULT_CHARTER_LIMITS, Ht as assertEditAuthorized, It as compareOrderedItems, M as verifySourceProjection, N as applyOps, Q as charterInitializeRequestSchema, S as assertRestorableArchive, U as normalizeEditRequest, Ut as bootstrapFromEvents, V as clientRefsOf, Vt as sha256Text, Z as charterIdentitySchema, Zt as clampCharterLimits, _ as migrateRecordV1ToV2, a as appendMaintenanceReceipt, at as charterRecordArchiveSchema, b as assertArchiveAdmission, c as assertRecoveryRecordAdmission, ct as charterRecordV1Schema, d as createEmptyRecord, g as maintenanceRequestDigestOf, h as legacyValidityFor, i as RevisionConflict, j as messageProjectionDigest, k as agentProjectionDigest, lt as charterRestoreRequestSchema, m as isRecordOverBudget, nn as CharterError, q as charterBootstrapApplyRequestSchema, r as MutationReplay, rn as charterError, s as assertRecordConsistency, st as charterRecordSchema, t as forkRecord, u as commitRecord, v as requestDigestOf, x as assertRecoveryRequestAdmission, y as restoredRecord, z as dependencyConflictDiff, zt as isStandingItem } from "./fork-KSL6sovw.js";
|
|
2
2
|
import { createHash, randomUUID } from "node:crypto";
|
|
3
3
|
import { Service } from "@deepseek-ai/cordis";
|
|
4
4
|
import Schema from "@deepseek-ai/schemastery";
|
|
@@ -147,6 +147,7 @@ function planChangeSet(input) {
|
|
|
147
147
|
const after = side(applied.snapshot);
|
|
148
148
|
const promptChanged = applied.snapshot.promptText !== input.snapshot.promptText;
|
|
149
149
|
const metadataOnly = applied.changes.every((change) => change.type === "item.accepted" || change.type === "item.rejected" || change.type === "item.archived" || change.type === "item.restored" || change.type === "item.superseded" || change.type === "item.purged" || change.type === "item.verification.changed") && !promptChanged;
|
|
150
|
+
const dependencyConflicts = dependencyConflictDiff(input.snapshot.items, applied.snapshot.items);
|
|
150
151
|
const summaryDigest = sha256Json({
|
|
151
152
|
version: 1,
|
|
152
153
|
baseRevision: input.snapshot.revision,
|
|
@@ -169,7 +170,8 @@ function planChangeSet(input) {
|
|
|
169
170
|
changes: [...applied.changes],
|
|
170
171
|
summaryDigest,
|
|
171
172
|
promptChanged,
|
|
172
|
-
metadataOnly
|
|
173
|
+
metadataOnly,
|
|
174
|
+
dependencyConflicts
|
|
173
175
|
};
|
|
174
176
|
}
|
|
175
177
|
/** Digest of the reviewed request, bound to the authoritative snapshot. */
|
|
@@ -2139,7 +2141,8 @@ var CharterService = class extends Service {
|
|
|
2139
2141
|
after: planned.after,
|
|
2140
2142
|
changes: [...planned.changes],
|
|
2141
2143
|
promptChanged: planned.promptChanged,
|
|
2142
|
-
metadataOnly: planned.metadataOnly
|
|
2144
|
+
metadataOnly: planned.metadataOnly,
|
|
2145
|
+
dependencyConflicts: planned.dependencyConflicts
|
|
2143
2146
|
};
|
|
2144
2147
|
} catch (error) {
|
|
2145
2148
|
return {
|
package/lib/version.d.ts
CHANGED