@lannguyensi/harness 0.20.0 → 0.21.1

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.
@@ -142,6 +142,7 @@ export declare const PolicySchema: z.ZodEffects<z.ZodObject<{
142
142
  min?: number | undefined;
143
143
  max?: number | undefined;
144
144
  }>>;
145
+ at_head: z.ZodOptional<z.ZodBoolean>;
145
146
  }, "strict", z.ZodTypeAny, {
146
147
  ledger_tag: string;
147
148
  within?: string | undefined;
@@ -150,6 +151,7 @@ export declare const PolicySchema: z.ZodEffects<z.ZodObject<{
150
151
  min?: number | undefined;
151
152
  max?: number | undefined;
152
153
  } | undefined;
154
+ at_head?: boolean | undefined;
153
155
  }, {
154
156
  ledger_tag: string;
155
157
  within?: string | undefined;
@@ -158,6 +160,7 @@ export declare const PolicySchema: z.ZodEffects<z.ZodObject<{
158
160
  min?: number | undefined;
159
161
  max?: number | undefined;
160
162
  } | undefined;
163
+ at_head?: boolean | undefined;
161
164
  }>;
162
165
  hook: z.ZodString;
163
166
  enforcement: z.ZodEnum<["block", "warn"]>;
@@ -232,6 +235,7 @@ export declare const PolicySchema: z.ZodEffects<z.ZodObject<{
232
235
  min?: number | undefined;
233
236
  max?: number | undefined;
234
237
  } | undefined;
238
+ at_head?: boolean | undefined;
235
239
  };
236
240
  hook: string;
237
241
  enforcement: "warn" | "block";
@@ -272,6 +276,7 @@ export declare const PolicySchema: z.ZodEffects<z.ZodObject<{
272
276
  min?: number | undefined;
273
277
  max?: number | undefined;
274
278
  } | undefined;
279
+ at_head?: boolean | undefined;
275
280
  };
276
281
  hook: string;
277
282
  enforcement: "warn" | "block";
@@ -312,6 +317,7 @@ export declare const PolicySchema: z.ZodEffects<z.ZodObject<{
312
317
  min?: number | undefined;
313
318
  max?: number | undefined;
314
319
  } | undefined;
320
+ at_head?: boolean | undefined;
315
321
  };
316
322
  hook: string;
317
323
  enforcement: "warn" | "block";
@@ -352,6 +358,7 @@ export declare const PolicySchema: z.ZodEffects<z.ZodObject<{
352
358
  min?: number | undefined;
353
359
  max?: number | undefined;
354
360
  } | undefined;
361
+ at_head?: boolean | undefined;
355
362
  };
356
363
  hook: string;
357
364
  enforcement: "warn" | "block";
@@ -445,6 +452,7 @@ export declare const PoliciesSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodO
445
452
  min?: number | undefined;
446
453
  max?: number | undefined;
447
454
  }>>;
455
+ at_head: z.ZodOptional<z.ZodBoolean>;
448
456
  }, "strict", z.ZodTypeAny, {
449
457
  ledger_tag: string;
450
458
  within?: string | undefined;
@@ -453,6 +461,7 @@ export declare const PoliciesSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodO
453
461
  min?: number | undefined;
454
462
  max?: number | undefined;
455
463
  } | undefined;
464
+ at_head?: boolean | undefined;
456
465
  }, {
457
466
  ledger_tag: string;
458
467
  within?: string | undefined;
@@ -461,6 +470,7 @@ export declare const PoliciesSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodO
461
470
  min?: number | undefined;
462
471
  max?: number | undefined;
463
472
  } | undefined;
473
+ at_head?: boolean | undefined;
464
474
  }>;
465
475
  hook: z.ZodString;
466
476
  enforcement: z.ZodEnum<["block", "warn"]>;
@@ -535,6 +545,7 @@ export declare const PoliciesSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodO
535
545
  min?: number | undefined;
536
546
  max?: number | undefined;
537
547
  } | undefined;
548
+ at_head?: boolean | undefined;
538
549
  };
539
550
  hook: string;
540
551
  enforcement: "warn" | "block";
@@ -575,6 +586,7 @@ export declare const PoliciesSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodO
575
586
  min?: number | undefined;
576
587
  max?: number | undefined;
577
588
  } | undefined;
589
+ at_head?: boolean | undefined;
578
590
  };
579
591
  hook: string;
580
592
  enforcement: "warn" | "block";
@@ -615,6 +627,7 @@ export declare const PoliciesSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodO
615
627
  min?: number | undefined;
616
628
  max?: number | undefined;
617
629
  } | undefined;
630
+ at_head?: boolean | undefined;
618
631
  };
619
632
  hook: string;
620
633
  enforcement: "warn" | "block";
@@ -655,6 +668,7 @@ export declare const PoliciesSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodO
655
668
  min?: number | undefined;
656
669
  max?: number | undefined;
657
670
  } | undefined;
671
+ at_head?: boolean | undefined;
658
672
  };
659
673
  hook: string;
660
674
  enforcement: "warn" | "block";
@@ -695,6 +709,7 @@ export declare const PoliciesSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodO
695
709
  min?: number | undefined;
696
710
  max?: number | undefined;
697
711
  } | undefined;
712
+ at_head?: boolean | undefined;
698
713
  };
699
714
  hook: string;
700
715
  enforcement: "warn" | "block";
@@ -735,6 +750,7 @@ export declare const PoliciesSchema: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodO
735
750
  min?: number | undefined;
736
751
  max?: number | undefined;
737
752
  } | undefined;
753
+ at_head?: boolean | undefined;
738
754
  };
739
755
  hook: string;
740
756
  enforcement: "warn" | "block";
@@ -93,6 +93,20 @@ export declare const RequiresSchema: z.ZodObject<{
93
93
  min?: number | undefined;
94
94
  max?: number | undefined;
95
95
  }>>;
96
+ /**
97
+ * When true, a tag-matching ledger entry whose `head:<sha>` token
98
+ * equals the runtime-resolved current HEAD sha satisfies the gate
99
+ * regardless of `within`. Falls through to the time-window check
100
+ * when no entry head-matches (entry predates the head shift,
101
+ * operator switched branches, producer ran on a different HEAD,
102
+ * runtime could not resolve the current HEAD). The producer must
103
+ * emit `head:<sha>` into the entry content for this to bite; the
104
+ * standard `harness session-start preflight` producer does so as
105
+ * of the `at_head` rollout. Designed for `preflight-before-push`
106
+ * to eliminate per-commit re-preflight churn while keeping the
107
+ * time-window as a freshness ceiling for the head-mismatch case.
108
+ */
109
+ at_head: z.ZodOptional<z.ZodBoolean>;
96
110
  }, "strict", z.ZodTypeAny, {
97
111
  ledger_tag: string;
98
112
  within?: string | undefined;
@@ -101,6 +115,7 @@ export declare const RequiresSchema: z.ZodObject<{
101
115
  min?: number | undefined;
102
116
  max?: number | undefined;
103
117
  } | undefined;
118
+ at_head?: boolean | undefined;
104
119
  }, {
105
120
  ledger_tag: string;
106
121
  within?: string | undefined;
@@ -109,6 +124,7 @@ export declare const RequiresSchema: z.ZodObject<{
109
124
  min?: number | undefined;
110
125
  max?: number | undefined;
111
126
  } | undefined;
127
+ at_head?: boolean | undefined;
112
128
  }>;
113
129
  export type Requires = z.infer<typeof RequiresSchema>;
114
130
  export declare function referencedVariables(template: string): string[];
@@ -33,6 +33,20 @@ export const RequiresSchema = z
33
33
  ledger_tag: z.string().min(1),
34
34
  within: DurationSchema.optional(),
35
35
  count: CountSchema.optional(),
36
+ /**
37
+ * When true, a tag-matching ledger entry whose `head:<sha>` token
38
+ * equals the runtime-resolved current HEAD sha satisfies the gate
39
+ * regardless of `within`. Falls through to the time-window check
40
+ * when no entry head-matches (entry predates the head shift,
41
+ * operator switched branches, producer ran on a different HEAD,
42
+ * runtime could not resolve the current HEAD). The producer must
43
+ * emit `head:<sha>` into the entry content for this to bite; the
44
+ * standard `harness session-start preflight` producer does so as
45
+ * of the `at_head` rollout. Designed for `preflight-before-push`
46
+ * to eliminate per-commit re-preflight churn while keeping the
47
+ * time-window as a freshness ceiling for the head-mismatch case.
48
+ */
49
+ at_head: z.boolean().optional(),
36
50
  })
37
51
  .strict();
38
52
  // The five built-ins ship resolved by the runtime, so policies may
@@ -1 +1 @@
1
- {"version":3,"file":"requires.js","sourceRoot":"","sources":["../../src/schema/requires.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,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,sCAAsC;AACtC,EAAE;AACF,oEAAoE;AACpE,0EAA0E;AAC1E,wEAAwE;AACxE,iFAAiF;AACjF,gBAAgB;AAChB,8EAA8E;AAC9E,iFAAiF;AACjF,qDAAqD;AACrD,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,MAAM;AACN,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,WAAW;IACX,KAAK;CACN,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,0BAA0B,CAAC;AAE9C,MAAM,UAAU,mBAAmB,CAAC,QAAgB;IAClD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9C,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lannguyensi/harness",
3
- "version": "0.20.0",
3
+ "version": "0.21.1",
4
4
  "description": "Declarative control plane for agent harnesses — one YAML for grounding, tools, memory, and hooks.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/LanNguyenSi/harness",