@punica/editor 1.43.0 → 1.45.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punica/editor",
3
- "version": "1.43.0",
3
+ "version": "1.45.0",
4
4
  "description": "Punica Editor",
5
5
  "private": false,
6
6
  "type": "module",
@@ -78,6 +78,26 @@ declare module 'punica' {
78
78
  * asks the right one. Absent means the file named none.
79
79
  */
80
80
  org?: string;
81
+ /**
82
+ * How many of them must sign (`kernel.PolicyRequest.signatures`),
83
+ * when more than one. A card then says how many have, and offers
84
+ * a signature rather than a grant.
85
+ */
86
+ signatures?: number;
87
+ /**
88
+ * Who has signed so far, under which name — the record's own
89
+ * list, copied onto the question by `approvePending` when a
90
+ * signature lands and the chain is still short. A person on it
91
+ * cannot sign again.
92
+ */
93
+ signed?: ReadonlyArray<{ by: string; role?: string; atMs: number }>;
94
+ /**
95
+ * The scope the first signature was recorded at. The next ones are
96
+ * recorded at the same scope, whatever the card offered: a grant
97
+ * is one record, and two signatures at two scopes would be two
98
+ * half-signed records.
99
+ */
100
+ signedScope?: ApprovalScope;
81
101
  /**
82
102
  * Set by `referPending`: the question was handed to a reviewer
83
103
  * outside this host, under this name. A run waiting on it holds
@@ -38,6 +38,16 @@ declare module 'punica' {
38
38
  * remote` reaches exactly the requests that carry this.
39
39
  */
40
40
  egress?: 'remote';
41
+ /**
42
+ * `'declared'` when the capability classifies itself or this call's
43
+ * input as sensitive (`dataClassification: 'sensitive'`, or a value
44
+ * at a schema path annotated `sensitive: true`), `'taint'` when a
45
+ * call earlier in the same trace read something declared sensitive
46
+ * and completed — as `egressGuard` resolved it. A rule with
47
+ * `sensitive: true` reaches exactly the requests that carry this
48
+ * (`docs/sensitive-data-egress.md` T2, T3).
49
+ */
50
+ sensitive?: 'declared' | 'taint';
41
51
  risk: PolicyRisk;
42
52
  approval: PolicyApproval;
43
53
  /**
@@ -85,6 +95,13 @@ declare module 'punica' {
85
95
  * role in any of the person's organisations counts.
86
96
  */
87
97
  org?: string;
98
+ /**
99
+ * How many of those approvers must sign before the grant stands
100
+ * (the deciding rule's `signatures:`). Absent or `1` is one
101
+ * decision; `2` means two different people, each one an entry
102
+ * names, and a record with fewer is consulted as no grant at all.
103
+ */
104
+ signatures?: number;
88
105
  }
89
106
 
90
107
  /**
@@ -130,6 +147,12 @@ declare module 'punica' {
130
147
  timestampMs: number;
131
148
  /** Optional reason — surfaced in audit. */
132
149
  reason?: string;
150
+ /**
151
+ * Under which of the rule's names this person signed (`owner`,
152
+ * `role:<name>`, `user:<email>`) — a `signatures` chain records it
153
+ * per signer, the way a single grant records `decidedRole`.
154
+ */
155
+ role?: string;
133
156
  }
134
157
 
135
158
  /** Chain-level outcome of `recordChainDecision`. */
@@ -154,6 +177,19 @@ declare module 'punica' {
154
177
  | {
155
178
  type: 'single';
156
179
  approver: ApproverSpec;
180
+ }
181
+ | {
182
+ /**
183
+ * A rule's `signatures: N` (1.44.0): `required` different
184
+ * people, each one of the rule's `approvers` entries, in any
185
+ * order; any deny ends it. The people are not known when the
186
+ * chain opens — a role names a set — so `approverId` is the
187
+ * signer's address and the spec lists the rule's entries, not
188
+ * ids. The policy manager is this shape's caller.
189
+ */
190
+ type: 'signatures';
191
+ required: number;
192
+ approvers: readonly string[];
157
193
  };
158
194
 
159
195
  /** Snapshot of a running chain — read-only from the caller's POV. */
@@ -192,6 +228,17 @@ declare module 'punica' {
192
228
  * record + chain state by this id.
193
229
  */
194
230
  chainRef?: string;
231
+ /**
232
+ * The signatures a `signatures: N` rule collected on this record
233
+ * (1.44.0): how many it needs and who signed, under which name. A
234
+ * record with fewer signatures than `need` is stored — so the next
235
+ * signer finds it and a reader sees who is missing — and is never
236
+ * consulted as a grant. Absent on a single-decision grant.
237
+ */
238
+ signatures?: {
239
+ need: number;
240
+ by: ReadonlyArray<{ by: string; role?: string; atMs: number }>;
241
+ };
195
242
  /**
196
243
  * The arguments this grant covers. See `PolicyRequest.argsBinding`.
197
244
  * Persisted so a grant matches only the arguments it was given
@@ -232,6 +279,8 @@ declare module 'punica' {
232
279
  approvers?: readonly string[];
233
280
  /** The organisation those approvers hold their roles in (the file's `org:`). */
234
281
  org?: string;
282
+ /** How many of them must sign (the rule's `signatures:`), when more than one. */
283
+ signatures?: number;
235
284
  reason?: string;
236
285
  /**
237
286
  * Set when a rule from a policy template decided this. Absent
@@ -524,6 +573,14 @@ declare module 'punica' {
524
573
  * (`docs/sensitive-data-egress.md`). The only value is `remote`.
525
574
  */
526
575
  egress?: 'remote';
576
+ /**
577
+ * Selects the calls that carry sensitive material — by the
578
+ * capability's declaration or by the run's taint, as the gate
579
+ * resolved it. The only value is `true`; written beside `egress:
580
+ * remote`, `deny` is the sentence "sensitive data does not leave this
581
+ * machine" while other remote calls still may.
582
+ */
583
+ sensitive?: true;
527
584
  effect: PolicyRuleEffect;
528
585
  /** ANDed. Absent or empty matches every argument tuple. */
529
586
  when?: PolicyCondition[];
@@ -549,6 +606,14 @@ declare module 'punica' {
549
606
  * which is what every rule written before this field meant.
550
607
  */
551
608
  approvers?: string[];
609
+ /**
610
+ * How many of those approvers must sign, only with `approvers:` on
611
+ * `effect: 'require'`. `2` is two different people, each one an
612
+ * entry names, in any order; one person cannot sign twice, and a
613
+ * signer needs a name. Absent or `1` is one decision, which is
614
+ * what every rule written before this field meant.
615
+ */
616
+ signatures?: number;
552
617
  /** Shown to the user on a denial and written into the audit record. */
553
618
  reason?: string;
554
619
  }
@@ -567,6 +632,10 @@ declare module 'punica' {
567
632
  approvers?: string[];
568
633
  /** The file's `org:`, when it wrote one — where those approvers hold their roles. */
569
634
  org?: string;
635
+ /** The rule's `signatures`, when more than one. */
636
+ signatures?: number;
637
+ /** The rule's `sensitive: true`, when it wrote it. */
638
+ sensitive?: true;
570
639
  /** Digest of the template's rules — which policy text was in force. */
571
640
  digest?: string;
572
641
  /**
@@ -574,7 +643,7 @@ declare module 'punica' {
574
643
  * declares. A reader of the audit record can otherwise not tell
575
644
  * why a rule naming no id applied to this call.
576
645
  */
577
- matchedBy?: 'id' | 'action' | 'egress';
646
+ matchedBy?: 'id' | 'action' | 'egress' | 'sensitive';
578
647
  }
579
648
 
580
649
  /** A rule that matched, plus the rule itself for the caller to read. */