things-api 0.16.0 → 0.18.0
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 +1 -1
- package/deputy/VERSION +1 -0
- package/deputy/helpers-Info.plist +23 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/CodeResources +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/Info.plist +20 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/MacOS/things-reader +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/_CodeSignature/CodeResources +115 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Info.plist +23 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/MacOS/things-deputy +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/_CodeSignature/CodeResources +125 -0
- package/deputy/reader/Info.plist +20 -0
- package/deputy/reader/entitlements.plist +15 -0
- package/deputy/reader/main.swift +491 -0
- package/deputy/src/main.swift +133 -0
- package/deputy/src/osascript.swift +102 -0
- package/deputy/src/server.swift +350 -0
- package/deputy/src/sqlite.swift +121 -0
- package/dist/cli/commands/doctor.js +55 -2
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/helpers.d.ts +17 -0
- package/dist/cli/commands/helpers.js +148 -0
- package/dist/cli/commands/helpers.js.map +1 -0
- package/dist/cli/commands/op-result.d.ts +15 -0
- package/dist/cli/commands/op-result.js +39 -0
- package/dist/cli/commands/op-result.js.map +1 -0
- package/dist/cli/commands/repeat-flags.d.ts +3 -3
- package/dist/cli/commands/repeat-flags.js +90 -33
- package/dist/cli/commands/repeat-flags.js.map +1 -1
- package/dist/cli/commands/writes.js +79 -6
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/cli/help.js +13 -2
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/helpers-check.d.ts +10 -0
- package/dist/cli/helpers-check.js +59 -0
- package/dist/cli/helpers-check.js.map +1 -0
- package/dist/cli/interrupt.d.ts +42 -0
- package/dist/cli/interrupt.js +105 -0
- package/dist/cli/interrupt.js.map +1 -0
- package/dist/cli/main.js +27 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/client.js +19 -2
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +70 -0
- package/dist/config.js +25 -1
- package/dist/config.js.map +1 -1
- package/dist/contracts.d.ts +9 -2
- package/dist/contracts.js +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/db/baselines/db-v26.js +8 -4
- package/dist/db/baselines/db-v26.js.map +1 -1
- package/dist/db/baselines/db-v27.d.ts +42 -0
- package/dist/db/baselines/db-v27.js +47 -0
- package/dist/db/baselines/db-v27.js.map +1 -0
- package/dist/db/baselines/index.js +2 -1
- package/dist/db/baselines/index.js.map +1 -1
- package/dist/db/locate.d.ts +4 -1
- package/dist/db/locate.js +3 -1
- package/dist/db/locate.js.map +1 -1
- package/dist/db/schema.d.ts +1 -1
- package/dist/db/schema.js +9 -0
- package/dist/db/schema.js.map +1 -1
- package/dist/deputy/bridge-worker.d.ts +1 -0
- package/dist/deputy/bridge-worker.js +79 -0
- package/dist/deputy/bridge-worker.js.map +1 -0
- package/dist/deputy/bridge.d.ts +14 -0
- package/dist/deputy/bridge.js +70 -0
- package/dist/deputy/bridge.js.map +1 -0
- package/dist/deputy/client.d.ts +19 -0
- package/dist/deputy/client.js +104 -0
- package/dist/deputy/client.js.map +1 -0
- package/dist/deputy/db-facade.d.ts +18 -0
- package/dist/deputy/db-facade.js +71 -0
- package/dist/deputy/db-facade.js.map +1 -0
- package/dist/deputy/files.d.ts +1 -0
- package/dist/deputy/files.js +16 -0
- package/dist/deputy/files.js.map +1 -0
- package/dist/deputy/install.d.ts +105 -0
- package/dist/deputy/install.js +467 -0
- package/dist/deputy/install.js.map +1 -0
- package/dist/deputy/notice.d.ts +6 -0
- package/dist/deputy/notice.js +28 -0
- package/dist/deputy/notice.js.map +1 -0
- package/dist/deputy/notices.d.ts +31 -0
- package/dist/deputy/notices.js +94 -0
- package/dist/deputy/notices.js.map +1 -0
- package/dist/deputy/osa.d.ts +21 -0
- package/dist/deputy/osa.js +72 -0
- package/dist/deputy/osa.js.map +1 -0
- package/dist/deputy/protocol.d.ts +86 -0
- package/dist/deputy/protocol.js +106 -0
- package/dist/deputy/protocol.js.map +1 -0
- package/dist/deputy/routing.d.ts +63 -0
- package/dist/deputy/routing.js +338 -0
- package/dist/deputy/routing.js.map +1 -0
- package/dist/deputy/shortcuts-exec.d.ts +10 -0
- package/dist/deputy/shortcuts-exec.js +50 -0
- package/dist/deputy/shortcuts-exec.js.map +1 -0
- package/dist/diagnose.d.ts +43 -1
- package/dist/diagnose.js +64 -2
- package/dist/diagnose.js.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +25 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/mappers.d.ts +12 -3
- package/dist/model/mappers.js +6 -1
- package/dist/model/mappers.js.map +1 -1
- package/dist/model/occurrences.d.ts +14 -1
- package/dist/model/occurrences.js +20 -4
- package/dist/model/occurrences.js.map +1 -1
- package/dist/model/recurrence.d.ts +64 -9
- package/dist/model/recurrence.js +94 -19
- package/dist/model/recurrence.js.map +1 -1
- package/dist/model/template-projection.d.ts +26 -0
- package/dist/model/template-projection.js +113 -0
- package/dist/model/template-projection.js.map +1 -0
- package/dist/op-result.d.ts +46 -0
- package/dist/op-result.js +156 -0
- package/dist/op-result.js.map +1 -0
- package/dist/paths.d.ts +8 -0
- package/dist/paths.js +10 -0
- package/dist/paths.js.map +1 -1
- package/dist/read/detail.js +7 -1
- package/dist/read/detail.js.map +1 -1
- package/dist/read/queries.js +8 -1
- package/dist/read/queries.js.map +1 -1
- package/dist/read/views.d.ts +6 -4
- package/dist/read/views.js +60 -18
- package/dist/read/views.js.map +1 -1
- package/dist/sync-health.js +8 -3
- package/dist/sync-health.js.map +1 -1
- package/dist/trace/tracer.d.ts +87 -0
- package/dist/trace/tracer.js +167 -0
- package/dist/trace/tracer.js.map +1 -0
- package/dist/write/accessibility-probe.js +4 -2
- package/dist/write/accessibility-probe.js.map +1 -1
- package/dist/write/automation-probe.js +5 -1
- package/dist/write/automation-probe.js.map +1 -1
- package/dist/write/availability.js +7 -3
- package/dist/write/availability.js.map +1 -1
- package/dist/write/clear-reminder.js +24 -21
- package/dist/write/clear-reminder.js.map +1 -1
- package/dist/write/commands.js +95 -45
- package/dist/write/commands.js.map +1 -1
- package/dist/write/completion-context.d.ts +57 -0
- package/dist/write/completion-context.js +49 -0
- package/dist/write/completion-context.js.map +1 -0
- package/dist/write/experimental.d.ts +19 -0
- package/dist/write/experimental.js +50 -0
- package/dist/write/experimental.js.map +1 -1
- package/dist/write/failure-hints.d.ts +10 -1
- package/dist/write/failure-hints.js +8 -0
- package/dist/write/failure-hints.js.map +1 -1
- package/dist/write/guards.d.ts +1 -1
- package/dist/write/guards.js +10 -0
- package/dist/write/guards.js.map +1 -1
- package/dist/write/move.js +14 -6
- package/dist/write/move.js.map +1 -1
- package/dist/write/operations.d.ts +40 -7
- package/dist/write/pipeline.d.ts +41 -0
- package/dist/write/pipeline.js +289 -19
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/pre-state.d.ts +1 -1
- package/dist/write/pre-state.js +35 -17
- package/dist/write/pre-state.js.map +1 -1
- package/dist/write/promote-clone.js +434 -19
- package/dist/write/promote-clone.js.map +1 -1
- package/dist/write/reorder.js +76 -27
- package/dist/write/reorder.js.map +1 -1
- package/dist/write/repeat-anchor.d.ts +140 -0
- package/dist/write/repeat-anchor.js +403 -0
- package/dist/write/repeat-anchor.js.map +1 -0
- package/dist/write/repeat-asserts.d.ts +28 -0
- package/dist/write/repeat-asserts.js +169 -0
- package/dist/write/repeat-asserts.js.map +1 -0
- package/dist/write/repeat-rule.js +37 -12
- package/dist/write/repeat-rule.js.map +1 -1
- package/dist/write/vectors/applescript.js +7 -16
- package/dist/write/vectors/applescript.js.map +1 -1
- package/dist/write/vectors/session-reachability.d.ts +133 -0
- package/dist/write/vectors/session-reachability.js +151 -0
- package/dist/write/vectors/session-reachability.js.map +1 -0
- package/dist/write/vectors/shortcuts.js +5 -14
- package/dist/write/vectors/shortcuts.js.map +1 -1
- package/dist/write/vectors/simulator.d.ts +16 -1
- package/dist/write/vectors/simulator.js +122 -32
- package/dist/write/vectors/simulator.js.map +1 -1
- package/dist/write/vectors/types.d.ts +183 -10
- package/dist/write/vectors/ui-recipes.d.ts +8 -0
- package/dist/write/vectors/ui-recipes.js +246 -58
- package/dist/write/vectors/ui-recipes.js.map +1 -1
- package/dist/write/vectors/ui.d.ts +156 -14
- package/dist/write/vectors/ui.js +846 -84
- package/dist/write/vectors/ui.js.map +1 -1
- package/dist/write/verify/delta.d.ts +12 -14
- package/dist/write/verify/delta.js +35 -34
- package/dist/write/verify/delta.js.map +1 -1
- package/dist/write/verify/poller.d.ts +13 -0
- package/dist/write/verify/poller.js +38 -0
- package/dist/write/verify/poller.js.map +1 -1
- package/package.json +8 -1
- package/schema/envelope.schema.json +22 -0
- package/scripts/build-helpers.sh +104 -0
- package/scripts/deputy-cert-setup.sh +60 -0
- package/skills/things-cli/SKILL.md +11 -3
- package/skills/things-cli/references/errors.md +4 -0
- package/skills/things-cli/references/repeating.md +69 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"availability.js","sourceRoot":"","sources":["../../src/write/availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"availability.js","sourceRoot":"","sources":["../../src/write/availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE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EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,OAAO;QACL,OAAO;QACP,OAAO;QACP,MAAM,EACJ,OAAO,CAAC,MAAM,KAAK,CAAC;YAClB,CAAC,CAAC,mCAAmC;YACrC,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;gBACpB,CAAC,CAAC,kFAAkF;oBAClF,0CAA0C;gBAC5C,CAAC,CAAC,YAAY,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAmC;KAC1E,CAAC;AACJ,CAAC"}
|
|
@@ -8,13 +8,10 @@ const SET_DETAIL_PROXY = "things-proxy-set-detail";
|
|
|
8
8
|
export async function runClearReminder(deps, params, options = {}) {
|
|
9
9
|
const uuid = resolveTaskUuidPrefix(deps.db, params.uuid);
|
|
10
10
|
const forced = options.vector;
|
|
11
|
-
// Dry-run previews the primary (atomic Shortcuts) plan unless the caller
|
|
12
|
-
// forces the URL bounce — cheap and host-independent (no proxy probe).
|
|
13
|
-
if (options.dryRun === true && forced !== "url-scheme") {
|
|
14
|
-
return runMutation(deps, "todo.clear-dated-reminder", { uuid }, { ...options, vector: "shortcuts" });
|
|
15
|
-
}
|
|
16
11
|
// Uniform pre-checks (no reminder to clear / wrong target type) via the op's
|
|
17
|
-
// own hazard set — identical result whichever path we'd pick
|
|
12
|
+
// own hazard set — identical result whichever path we'd pick, and evaluated
|
|
13
|
+
// for dry-run too so a preview surfaces the same block. Host-independent (DB
|
|
14
|
+
// reads only; no proxy probe).
|
|
18
15
|
const target = loadTarget(deps.db, uuid);
|
|
19
16
|
const pre = emptyPreState();
|
|
20
17
|
pre.target = target;
|
|
@@ -39,8 +36,17 @@ export async function runClearReminder(deps, params, options = {}) {
|
|
|
39
36
|
remediation: block.remediation,
|
|
40
37
|
};
|
|
41
38
|
}
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
// A repeating TEMPLATE's reminder is a repeat-RULE property. On 3.22.12 (RRX1)
|
|
40
|
+
// it IS stored in the `reminderTime` column on the template AND its spawned
|
|
41
|
+
// instances, but NO automation surface can clear it in place: the Shortcuts
|
|
42
|
+
// `set-detail Reminder Time=""` is a silent no-op (proxy exits 0, the column is
|
|
43
|
+
// unchanged), the AppleScript de-schedule is refused (error 301), and a URL
|
|
44
|
+
// when= bounce CRASHES Things (§1). Earlier (RCLEAR / 3.22.11) the template's
|
|
45
|
+
// reminderTime was NULL, so H-NO-REMINDER caught this; now that the column
|
|
46
|
+
// carries a real value the op must refuse EXPLICITLY, else the Shortcuts path
|
|
47
|
+
// no-ops and the op verify-fails. (A reminderLESS template was already caught
|
|
48
|
+
// by H-NO-REMINDER above; this only fires when the template has a reminder.)
|
|
49
|
+
if (isRepeatingTemplate(target)) {
|
|
44
50
|
appendClearAudit(deps, {
|
|
45
51
|
uuid,
|
|
46
52
|
startedAt: deps.now?.() ?? new Date(),
|
|
@@ -51,21 +57,18 @@ export async function runClearReminder(deps, params, options = {}) {
|
|
|
51
57
|
op: "todo.clear-dated-reminder",
|
|
52
58
|
reason: "hazard",
|
|
53
59
|
hazard: "H-REPEAT-SCHEDULE",
|
|
54
|
-
detail: "
|
|
55
|
-
"
|
|
56
|
-
|
|
60
|
+
detail: "this is a repeating series — its reminder is part of the repeat rule, and no automation " +
|
|
61
|
+
"surface can clear it in place (the Shortcuts clear silently does nothing, the AppleScript " +
|
|
62
|
+
"de-schedule is refused, and a URL re-schedule crashes the app)",
|
|
63
|
+
remediation: "change the reminder in the app's repeat editor",
|
|
57
64
|
};
|
|
58
65
|
}
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
? false
|
|
66
|
-
: repeating
|
|
67
|
-
? true
|
|
68
|
-
: proxiesInstalled(deps);
|
|
66
|
+
// Dry-run previews the atomic Shortcuts plan unless the caller forces the URL
|
|
67
|
+
// bounce — host-independent (no proxy probe).
|
|
68
|
+
if (options.dryRun === true && forced !== "url-scheme") {
|
|
69
|
+
return runMutation(deps, "todo.clear-dated-reminder", { uuid }, { ...options, vector: "shortcuts" });
|
|
70
|
+
}
|
|
71
|
+
const useShortcuts = forced === "shortcuts" ? true : forced === "url-scheme" ? false : proxiesInstalled(deps);
|
|
69
72
|
if (useShortcuts) {
|
|
70
73
|
return runMutation(deps, "todo.clear-dated-reminder", { uuid }, { ...options, vector: "shortcuts" });
|
|
71
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-reminder.js","sourceRoot":"","sources":["../../src/write/clear-reminder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clear-reminder.js","sourceRoot":"","sources":["../../src/write/clear-reminder.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,WAAW,GAIZ,MAAM,eAAe,CAAC;AAEvB,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAAe,EACf,MAAkB,EAClB,UAAwB,EAAE;IAE1B,MAAM,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAE9B,6EAA6E;IAC7E,4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,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;QAC7E,GAAG,EAAE;YACH,GAAG,EAAE,IAAI,CAAC,UAAU,IAAI,OAAO;YAC/B,SAAS,EAAE,EAAE,CAAC,WAAW,CAAC,eAAe;YACzC,WAAW,EAAE,gBAAgB,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;SAC/C;KACF,CAAC;IACF,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
|
package/dist/write/commands.js
CHANGED
|
@@ -7,6 +7,8 @@ import { areaMemberCounts, childTagTitles, classifyHeadingConvert, classifyHeadi
|
|
|
7
7
|
import { resolveTagRefs } from "./tag-refs.js";
|
|
8
8
|
import { PRIVATE_REORDER_COMMAND } from "./experimental.js";
|
|
9
9
|
import { assertRepeatRule } from "./repeat-rule.js";
|
|
10
|
+
import { assessOffRuleFirst, deadlineDriveNext, deriveFixedAnchor } from "./repeat-anchor.js";
|
|
11
|
+
import { expectedRuleAssertions } from "./repeat-asserts.js";
|
|
10
12
|
import { escapeAppleScript } from "./vectors/applescript.js";
|
|
11
13
|
import { areaReorderSidebarRecipe, convertToProjectRecipe, dissolveHeadingRecipe, headingConvertToProjectRecipe, moveHeadingToProjectRecipe, makeRepeatingRecipe, pauseRepeatRecipe, projectMakeRepeatingRecipe, projectPauseRepeatRecipe, projectRescheduleRepeatRecipe, projectResumeRepeatRecipe, rescheduleRepeatRecipe, resumeRepeatRecipe, } from "./vectors/ui-recipes.js";
|
|
12
14
|
import { buildRepeatingFingerprint } from "./verify/delta.js";
|
|
@@ -455,9 +457,12 @@ function statusSpec(op, urlParam, asStatus, scriptStatus) {
|
|
|
455
457
|
return {
|
|
456
458
|
op,
|
|
457
459
|
hazards: ["H-UNKNOWN-DESTINATION", "H-REPEAT-SCHEDULE"],
|
|
458
|
-
preRead(db, params) {
|
|
460
|
+
preRead(db, params, now, zone) {
|
|
459
461
|
const pre = emptyPreState();
|
|
460
|
-
|
|
462
|
+
// Load under the response clock so the target's Today marker (read by the
|
|
463
|
+
// HINTS1 completion-context) reflects the same calendar day the pipeline
|
|
464
|
+
// verifies under, not the host wall clock.
|
|
465
|
+
pre.target = loadTarget(db, params.uuid, now, zone);
|
|
461
466
|
return pre;
|
|
462
467
|
},
|
|
463
468
|
expectedDelta(_pre, params) {
|
|
@@ -1912,8 +1917,46 @@ function ruleExtras(params) {
|
|
|
1912
1917
|
...(params.reminder !== undefined && { reminder: params.reminder }),
|
|
1913
1918
|
...(params.deadline !== undefined && { deadline: params.deadline }),
|
|
1914
1919
|
...(params.startDaysEarlier !== undefined && { startDaysEarlier: params.startDaysEarlier }),
|
|
1920
|
+
...(params.next !== undefined && { next: params.next }),
|
|
1915
1921
|
};
|
|
1916
1922
|
}
|
|
1923
|
+
/**
|
|
1924
|
+
* The reschedule's EFFECTIVE rule params: the requested params PLUS the calendar
|
|
1925
|
+
* anchor DERIVED from `--when` when none was given explicitly (YANCH1 #493 — the
|
|
1926
|
+
* SAME derive-and-drive make/add-repeating apply upstream in promote-clone.ts).
|
|
1927
|
+
* The anchor is derived from the deadline-shifted drive date (`deadlineDriveNext`
|
|
1928
|
+
* = when + startDaysEarlier) so a deadlined rule's anchor names the DUE date,
|
|
1929
|
+
* exactly as make/add. A rule-only reschedule (no `--when`) or an explicit anchor
|
|
1930
|
+
* flag leaves params UNCHANGED (deriveFixedAnchor returns an empty patch).
|
|
1931
|
+
*
|
|
1932
|
+
* This is the single source of truth used by BOTH the compile (`reschedRuleExtras`
|
|
1933
|
+
* → the recipe DRIVES the anchor pop-ups) AND expectedDelta (`expectedRuleAssertions`
|
|
1934
|
+
* ASSERTS the same anchor), so the drive vocabulary and the verify vocabulary
|
|
1935
|
+
* derive IDENTICALLY. Without it a `--when`-only reschedule left the anchor at the
|
|
1936
|
+
* dialog's untouched default (yearly January 1, monthly 1st, weekly Sunday) — the
|
|
1937
|
+
* DRIVE never touched the anchor pop-ups while the reschedule silently kept the old
|
|
1938
|
+
* placement (the RSPA1 live failure: a yearly `--when`-only reschedule whose anchor
|
|
1939
|
+
* was never driven).
|
|
1940
|
+
*/
|
|
1941
|
+
function reschedEffParams(params) {
|
|
1942
|
+
return { ...params, ...deriveFixedAnchor(params, deadlineDriveNext(params)) };
|
|
1943
|
+
}
|
|
1944
|
+
/**
|
|
1945
|
+
* Recipe extras for a RESCHEDULE: the derived-anchor effective params (so the
|
|
1946
|
+
* recipe drives the weekly/monthly/yearly anchor pop-ups for a `--when`-only
|
|
1947
|
+
* reschedule), with the "Next:" drive date deadline-adjusted (YANCH1 #493) —
|
|
1948
|
+
* `--when` is the scheduled START, but a deadlined rule anchors on the DEADLINE,
|
|
1949
|
+
* so the dialog's "Next:" field is driven with `when + startDaysEarlier` and the
|
|
1950
|
+
* app back-shifts the instance start to `--when`. The expectedDelta keeps the RAW
|
|
1951
|
+
* `params.next` (the cursor asserts the START). make/add-repeating apply this shift
|
|
1952
|
+
* upstream (promote-clone.ts) and pass an already-adjusted rule, so only the
|
|
1953
|
+
* reschedule compile needs it here.
|
|
1954
|
+
*/
|
|
1955
|
+
function reschedRuleExtras(params) {
|
|
1956
|
+
const base = ruleExtras(reschedEffParams(params));
|
|
1957
|
+
const drive = deadlineDriveNext(params);
|
|
1958
|
+
return drive !== undefined ? { ...base, next: drive } : base;
|
|
1959
|
+
}
|
|
1917
1960
|
/** ui ops all guard existence/type + the H-UI-DRIVE acknowledgement. */
|
|
1918
1961
|
const UI_HAZARDS = ["H-UNKNOWN-DESTINATION", "H-UI-DRIVE"];
|
|
1919
1962
|
const todoMakeRepeating = {
|
|
@@ -1934,9 +1977,12 @@ const todoMakeRepeating = {
|
|
|
1934
1977
|
// rows), pick it by asserting it IS a template, then the `repeating` context
|
|
1935
1978
|
// hardens discovery (restored time-bound, source-fingerprint tiebreak) and
|
|
1936
1979
|
// derives instance + source fate for the enriched result. `expectedRule`
|
|
1937
|
-
// makes the LANDED rule verifiable: a template minted
|
|
1938
|
-
// frequency/interval (the interval-field race, oddities §8l)
|
|
1939
|
-
// verify-failed:mismatch instead
|
|
1980
|
+
// makes the LANDED rule verifiable at FULL fidelity (#491): a template minted
|
|
1981
|
+
// with the wrong frequency/interval (the interval-field race, oddities §8l) OR
|
|
1982
|
+
// a dropped anchor / ends / deadline becomes a verify-failed:mismatch instead
|
|
1983
|
+
// of a silent ok. includeCursor:false — the fresh template's cursor follows
|
|
1984
|
+
// the app's spawn law (ANCH1), not the raw --when, so make verifies the rule
|
|
1985
|
+
// BLOB + deadline, not the cursor.
|
|
1940
1986
|
return {
|
|
1941
1987
|
mode: "create",
|
|
1942
1988
|
probe: {
|
|
@@ -1948,11 +1994,7 @@ const todoMakeRepeating = {
|
|
|
1948
1994
|
repeating: {
|
|
1949
1995
|
sourceUuid: pre.target.uuid,
|
|
1950
1996
|
fingerprint: buildRepeatingFingerprint(pre.target),
|
|
1951
|
-
expectedRule: {
|
|
1952
|
-
type: params.afterCompletion === true ? "after-completion" : "fixed",
|
|
1953
|
-
unit: params.frequency,
|
|
1954
|
-
interval: params.interval,
|
|
1955
|
-
},
|
|
1997
|
+
expectedRule: expectedRuleAssertions(params, { includeCursor: false }),
|
|
1956
1998
|
},
|
|
1957
1999
|
}),
|
|
1958
2000
|
},
|
|
@@ -1975,33 +2017,37 @@ const todoRescheduleRepeat = {
|
|
|
1975
2017
|
return pre;
|
|
1976
2018
|
},
|
|
1977
2019
|
expectedDelta(_pre, params) {
|
|
1978
|
-
// Identity PRESERVED (UI2-b): the same template uuid, rule mutated in
|
|
1979
|
-
//
|
|
1980
|
-
//
|
|
1981
|
-
//
|
|
1982
|
-
//
|
|
1983
|
-
//
|
|
1984
|
-
//
|
|
1985
|
-
//
|
|
1986
|
-
//
|
|
2020
|
+
// Identity PRESERVED (UI2-b): the same template uuid, rule mutated in place.
|
|
2021
|
+
// Assert the FULL requested rule (#491) — type + unit + interval + calendar
|
|
2022
|
+
// anchor + ends bound + deadline offset + the ANCH2 first-occurrence cursor —
|
|
2023
|
+
// built from the complete vocabulary by expectedRuleAssertions so the pre-drive
|
|
2024
|
+
// idempotency check skips ONLY when EVERY requested field already holds, and
|
|
2025
|
+
// the post-drive verify catches a wrong-anchor landing. A shallow unit+interval
|
|
2026
|
+
// subset false-noop'd a reschedule that changed only the monthly anchor /
|
|
2027
|
+
// deadline / ends (#491). ALSO capture the whole prior rule (+ deadline flag)
|
|
2028
|
+
// so the undo can re-drive it faithfully. The DERIVED-anchor effective params
|
|
2029
|
+
// (reschedEffParams) are asserted — the SAME bag the compile drives — so a
|
|
2030
|
+
// `--when`-only reschedule verifies the derived anchor the drive lands (RSPA1).
|
|
2031
|
+
const eff = reschedEffParams(params);
|
|
1987
2032
|
return {
|
|
1988
2033
|
mode: "update",
|
|
1989
2034
|
uuid: params.uuid,
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2035
|
+
// includeCursor asserts the first-occurrence cursor == --when. For an OFF-RULE
|
|
2036
|
+
// first (explicit anchor ≠ --when) the cursor lands on the next RULE-ALIGNED
|
|
2037
|
+
// occurrence, not --when (DACON1 cell DC4: --when Oct 16 with an Oct-16 due
|
|
2038
|
+
// anchor cursors to the next aligned start, 2029-10-02), so asserting it would
|
|
2039
|
+
// false-fail an honored off-rule reschedule — drop the cursor assertion there
|
|
2040
|
+
// and verify the rule anchor only.
|
|
2041
|
+
assert: expectedRuleAssertions(eff, {
|
|
2042
|
+
includeCursor: assessOffRuleFirst(eff)?.kind !== "honored",
|
|
2043
|
+
}),
|
|
1998
2044
|
capture: [{ field: "repeating.rule" }, { field: "repeating.deadlined" }],
|
|
1999
2045
|
};
|
|
2000
2046
|
},
|
|
2001
2047
|
compile(params, vector) {
|
|
2002
2048
|
if (vector !== "ui")
|
|
2003
2049
|
unsupportedVector(this.op, vector);
|
|
2004
|
-
return uiDrive(rescheduleRepeatRecipe(params.uuid, params.frequency, params.interval,
|
|
2050
|
+
return uiDrive(rescheduleRepeatRecipe(params.uuid, params.frequency, params.interval, reschedRuleExtras(params)));
|
|
2005
2051
|
},
|
|
2006
2052
|
};
|
|
2007
2053
|
const todoPauseRepeat = {
|
|
@@ -2066,26 +2112,31 @@ const projectRescheduleRepeat = {
|
|
|
2066
2112
|
expectedDelta(_pre, params) {
|
|
2067
2113
|
// Identity PRESERVED (UIC2-a): same project uuid, rule mutated in place;
|
|
2068
2114
|
// capture the prior rule (+ deadline flag) for the faithful undo. Assert the
|
|
2069
|
-
//
|
|
2070
|
-
// unit+interval
|
|
2115
|
+
// FULL requested rule (#491) via expectedRuleAssertions — same completeness as
|
|
2116
|
+
// todo.reschedule-repeat (a shallow unit+interval subset false-noop'd an
|
|
2117
|
+
// anchor/deadline/ends-only reschedule). The DERIVED-anchor effective params
|
|
2118
|
+
// (reschedEffParams) are asserted — the SAME bag the compile drives — so a
|
|
2119
|
+
// `--when`-only reschedule verifies the derived anchor the drive lands (RSPA1).
|
|
2120
|
+
const eff = reschedEffParams(params);
|
|
2071
2121
|
return {
|
|
2072
2122
|
mode: "update",
|
|
2073
2123
|
uuid: params.uuid,
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2124
|
+
// includeCursor asserts the first-occurrence cursor == --when. For an OFF-RULE
|
|
2125
|
+
// first (explicit anchor ≠ --when) the cursor lands on the next RULE-ALIGNED
|
|
2126
|
+
// occurrence, not --when (DACON1 cell DC4: --when Oct 16 with an Oct-16 due
|
|
2127
|
+
// anchor cursors to the next aligned start, 2029-10-02), so asserting it would
|
|
2128
|
+
// false-fail an honored off-rule reschedule — drop the cursor assertion there
|
|
2129
|
+
// and verify the rule anchor only.
|
|
2130
|
+
assert: expectedRuleAssertions(eff, {
|
|
2131
|
+
includeCursor: assessOffRuleFirst(eff)?.kind !== "honored",
|
|
2132
|
+
}),
|
|
2082
2133
|
capture: [{ field: "repeating.rule" }, { field: "repeating.deadlined" }],
|
|
2083
2134
|
};
|
|
2084
2135
|
},
|
|
2085
2136
|
compile(params, vector) {
|
|
2086
2137
|
if (vector !== "ui")
|
|
2087
2138
|
unsupportedVector(this.op, vector);
|
|
2088
|
-
return uiDrive(projectRescheduleRepeatRecipe(params.uuid, params.frequency, params.interval,
|
|
2139
|
+
return uiDrive(projectRescheduleRepeatRecipe(params.uuid, params.frequency, params.interval, reschedRuleExtras(params)));
|
|
2089
2140
|
},
|
|
2090
2141
|
};
|
|
2091
2142
|
const projectPauseRepeat = {
|
|
@@ -2158,7 +2209,10 @@ const projectMakeRepeating = {
|
|
|
2158
2209
|
// the current-occurrence instance. Pick the TEMPLATE by asserting it IS one,
|
|
2159
2210
|
// excluding pre-existing same-title rows; the `repeating` context hardens
|
|
2160
2211
|
// discovery and derives instance + source fate + childrenReplaced.
|
|
2161
|
-
// `expectedRule` makes the landed rule verifiable
|
|
2212
|
+
// `expectedRule` makes the landed rule verifiable at FULL fidelity (#491):
|
|
2213
|
+
// a wrong frequency/interval (interval-race §8l) OR a dropped anchor/ends/
|
|
2214
|
+
// deadline is a mismatch, not a silent ok. includeCursor:false — the fresh
|
|
2215
|
+
// template's cursor follows the ANCH1 spawn law, not the raw --when.
|
|
2162
2216
|
return {
|
|
2163
2217
|
mode: "create",
|
|
2164
2218
|
probe: {
|
|
@@ -2171,11 +2225,7 @@ const projectMakeRepeating = {
|
|
|
2171
2225
|
sourceUuid: pre.target.uuid,
|
|
2172
2226
|
fingerprint: buildRepeatingFingerprint(pre.target),
|
|
2173
2227
|
subtreeUuids: pre.repeatSubtreeUuids ?? [],
|
|
2174
|
-
expectedRule: {
|
|
2175
|
-
type: params.afterCompletion === true ? "after-completion" : "fixed",
|
|
2176
|
-
unit: params.frequency,
|
|
2177
|
-
interval: params.interval,
|
|
2178
|
-
},
|
|
2228
|
+
expectedRule: expectedRuleAssertions(params, { includeCursor: false }),
|
|
2179
2229
|
},
|
|
2180
2230
|
}),
|
|
2181
2231
|
},
|