@deftai/directive-core 0.95.0 → 0.96.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.
Files changed (47) hide show
  1. package/dist/cache/archive.d.ts +134 -0
  2. package/dist/cache/archive.js +630 -0
  3. package/dist/cache/index.d.ts +1 -0
  4. package/dist/cache/index.js +1 -0
  5. package/dist/cache/main.js +298 -1
  6. package/dist/content-contracts/skills/helpers.d.ts +1 -1
  7. package/dist/content-contracts/skills/helpers.js +1 -0
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +1 -0
  10. package/dist/init-deposit/hygiene.d.ts +1 -1
  11. package/dist/init-deposit/hygiene.js +16 -4
  12. package/dist/init-deposit/scaffold.js +6 -5
  13. package/dist/parent-turn-shape/evaluate.d.ts +84 -0
  14. package/dist/parent-turn-shape/evaluate.js +353 -0
  15. package/dist/parent-turn-shape/index.d.ts +8 -0
  16. package/dist/parent-turn-shape/index.js +8 -0
  17. package/dist/review-monitor/constants.js +3 -2
  18. package/dist/review-monitor/tier-detection.d.ts +7 -3
  19. package/dist/review-monitor/tier-detection.js +18 -1
  20. package/dist/review-monitor/verify.js +18 -0
  21. package/dist/scope/index.d.ts +2 -0
  22. package/dist/scope/index.js +2 -0
  23. package/dist/scope/main.d.ts +10 -0
  24. package/dist/scope/main.js +109 -24
  25. package/dist/scope/promote-from-issue.d.ts +49 -0
  26. package/dist/scope/promote-from-issue.js +367 -0
  27. package/dist/scope/promote-path.d.ts +39 -0
  28. package/dist/scope/promote-path.js +105 -0
  29. package/dist/swarm/routing.d.ts +4 -2
  30. package/dist/swarm/routing.js +26 -4
  31. package/dist/triage/actions/index.js +62 -2
  32. package/dist/triage/actions/types.d.ts +8 -1
  33. package/dist/triage/author-filter.d.ts +51 -0
  34. package/dist/triage/author-filter.js +152 -0
  35. package/dist/triage/classify/index.d.ts +2 -2
  36. package/dist/triage/classify/index.js +2 -2
  37. package/dist/triage/classify/label-mirror.d.ts +68 -5
  38. package/dist/triage/classify/label-mirror.js +261 -31
  39. package/dist/triage/help/registry-data.d.ts +49 -38
  40. package/dist/triage/help/registry-data.js +115 -40
  41. package/dist/triage/index.d.ts +1 -0
  42. package/dist/triage/index.js +1 -0
  43. package/dist/triage/queue/index.d.ts +1 -0
  44. package/dist/triage/queue/index.js +1 -0
  45. package/dist/triage/queue/render.d.ts +2 -0
  46. package/dist/triage/queue/render.js +6 -0
  47. package/package.json +7 -3
@@ -0,0 +1,134 @@
1
+ import { ProjectionContainmentError } from "../fs/projection-containment.js";
2
+ import { type Clock } from "./time.js";
3
+ export { ProjectionContainmentError as CacheArchiveContainmentError };
4
+ /** Archive age default matches TTL prune window but is a separate concept (#1137). */
5
+ export declare const DEFAULT_ARCHIVE_OLDER_THAN_DAYS = 30;
6
+ export declare const ARCHIVE_SOURCE_GITHUB_ISSUE = "github-issue";
7
+ export declare const ARCHIVED_ROOT_SEGMENT = "archived";
8
+ export declare const ARCHIVE_META_FILENAME = "archive-meta.json";
9
+ export interface ArchiveMeta {
10
+ archived_at: string;
11
+ reason: string;
12
+ source_path: string;
13
+ key: string;
14
+ source: string;
15
+ pre_archive_decision?: string | null;
16
+ closed_at?: string | null;
17
+ age_basis?: string;
18
+ }
19
+ export type ArchiveSkipReason = "not-closed" | "too-recent" | "open-lifecycle-scope" | "non-terminal-decision" | "missing-raw" | "invalid-key" | "already-archived";
20
+ export interface ArchiveCandidate {
21
+ source: string;
22
+ key: string;
23
+ liveDir: string;
24
+ archiveDir: string;
25
+ closedAt: string | null;
26
+ ageBasis: string;
27
+ ageMs: number;
28
+ preArchiveDecision: string | null;
29
+ }
30
+ export interface ArchiveSkip {
31
+ source: string;
32
+ key: string;
33
+ reason: ArchiveSkipReason;
34
+ detail?: string;
35
+ }
36
+ export interface ArchiveClosedResult {
37
+ dryRun: boolean;
38
+ olderThanDays: number;
39
+ source: string;
40
+ repo: string | null;
41
+ archived: ArchiveCandidate[];
42
+ skipped: ArchiveSkip[];
43
+ archivedCount: number;
44
+ skippedCount: number;
45
+ }
46
+ export interface ArchivedEntry {
47
+ source: string;
48
+ key: string;
49
+ archiveDir: string;
50
+ archivedAt: string;
51
+ meta: ArchiveMeta;
52
+ }
53
+ export interface ArchiveListResult {
54
+ entries: ArchivedEntry[];
55
+ count: number;
56
+ source: string;
57
+ repo: string | null;
58
+ }
59
+ export interface RestoreResult {
60
+ source: string;
61
+ key: string;
62
+ status: "restored" | "already-live" | "missing" | "conflict";
63
+ liveDir: string;
64
+ archiveDir: string;
65
+ detail?: string;
66
+ }
67
+ /** Live entry dir for a github-issue key. */
68
+ export declare function liveEntryDir(source: string, key: string, cacheRoot: string): string;
69
+ /** Archived entry dir: `.deft-cache/archived/<source>/<owner>/<repo>/<N>/`. */
70
+ export declare function archivedEntryDir(source: string, key: string, cacheRoot: string): string;
71
+ /**
72
+ * Open-lifecycle protection set: preferred keys are `owner/repo#N`.
73
+ * Bare `#N` keys are also recorded when the plan URI has no repo (conservative).
74
+ */
75
+ export declare function openLifecycleReferencedKeys(projectRoot: string): ReadonlySet<string>;
76
+ /** True when cache key `owner/repo/N` is protected by open lifecycle refs. */
77
+ export declare function isLifecycleProtected(cacheKey: string, protectedKeys: ReadonlySet<string>): boolean;
78
+ /**
79
+ * Resolve closed age basis: `closed_at` from raw, else `meta.fetched_at`, else
80
+ * meta.json mtime (#1137).
81
+ */
82
+ export declare function resolveClosedAge(raw: Record<string, unknown>, meta: Record<string, unknown> | null, metaPath: string, now: Date): {
83
+ closedAt: string | null;
84
+ ageBasis: string;
85
+ ageMs: number;
86
+ };
87
+ export interface ArchiveClosedOptions {
88
+ olderThanDays?: number;
89
+ source?: string;
90
+ repo?: string | null;
91
+ dryRun?: boolean;
92
+ cacheRoot?: string;
93
+ projectRoot?: string;
94
+ /** Optional map of `owner/repo#N` or `N` → latest decision string. */
95
+ latestDecisions?: ReadonlyMap<string, string> | null;
96
+ /** When true, only archive reject / mark-duplicate latest decisions. */
97
+ terminalDecisionOnly?: boolean;
98
+ /** Override protected issue set (tests); default scans open lifecycle. */
99
+ protectedIssueNumbers?: ReadonlySet<number> | null;
100
+ /** Override protected keys `owner/repo#N` / `#N` (preferred multi-repo form). */
101
+ protectedKeys?: ReadonlySet<string> | null;
102
+ reason?: string;
103
+ clock?: Clock;
104
+ }
105
+ /**
106
+ * Archive closed github-issue cache entries older than the threshold.
107
+ * Skips (does not half-move) entries still referenced by open lifecycle scopes.
108
+ */
109
+ export declare function archiveClosedEntries(options?: ArchiveClosedOptions): ArchiveClosedResult;
110
+ export interface ArchiveListOptions {
111
+ source?: string;
112
+ repo?: string | null;
113
+ since?: string | null;
114
+ limit?: number | null;
115
+ cacheRoot?: string;
116
+ }
117
+ /** List archived entries newest `archived_at` first. */
118
+ export declare function listArchivedEntries(options?: ArchiveListOptions): ArchiveListResult;
119
+ export interface RestoreFromArchiveOptions {
120
+ source?: string;
121
+ key?: string;
122
+ issue?: number;
123
+ repo?: string | null;
124
+ force?: boolean;
125
+ cacheRoot?: string;
126
+ clock?: Clock;
127
+ }
128
+ /**
129
+ * Move an archived entry back to the live cache path.
130
+ * Idempotent no-op when already live with identical raw.json.
131
+ * Refuse when live exists with different content unless force.
132
+ */
133
+ export declare function restoreFromArchive(options?: RestoreFromArchiveOptions): RestoreResult;
134
+ //# sourceMappingURL=archive.d.ts.map