@happyvertical/smrt-ingestion 0.57.21 → 0.57.22

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 (83) hide show
  1. package/FEEDBACK.md +104 -0
  2. package/PROPOSALS.md +19 -0
  3. package/README.md +126 -0
  4. package/REVIEW.md +272 -4
  5. package/agents/execution.md +72 -0
  6. package/dist/chunks/{execution-9CfjxX8I.js → execution-BzVQax0n.js} +421 -23
  7. package/dist/chunks/execution-BzVQax0n.js.map +1 -0
  8. package/dist/chunks/{feedback-CuUzWKzP.js → feedback-D3UTF8fm.js} +119 -21
  9. package/dist/chunks/feedback-D3UTF8fm.js.map +1 -0
  10. package/dist/chunks/{extraction-CJ-zrbg0.js → proposal-contracts-77Uo1B1j.js} +39 -39
  11. package/dist/chunks/proposal-contracts-77Uo1B1j.js.map +1 -0
  12. package/dist/chunks/{reviewer-instruction-Db3jDN9a.js → reviewer-instruction-CEc3AOuU.js} +2 -2
  13. package/dist/chunks/{reviewer-instruction-Db3jDN9a.js.map → reviewer-instruction-CEc3AOuU.js.map} +1 -1
  14. package/dist/dto.d.ts +69 -0
  15. package/dist/dto.d.ts.map +1 -1
  16. package/dist/execution-contracts.d.ts +4 -1
  17. package/dist/execution-contracts.d.ts.map +1 -1
  18. package/dist/execution-dto.d.ts +16 -0
  19. package/dist/execution-dto.d.ts.map +1 -1
  20. package/dist/execution.d.ts +58 -3
  21. package/dist/execution.d.ts.map +1 -1
  22. package/dist/execution.js +2 -2
  23. package/dist/feedback-dto.d.ts +12 -4
  24. package/dist/feedback-dto.d.ts.map +1 -1
  25. package/dist/feedback-internal.d.ts +9 -0
  26. package/dist/feedback-internal.d.ts.map +1 -1
  27. package/dist/feedback.d.ts +3 -0
  28. package/dist/feedback.d.ts.map +1 -1
  29. package/dist/index.js +2 -2
  30. package/dist/manifest.json +321 -3
  31. package/dist/models.d.ts +15 -0
  32. package/dist/models.d.ts.map +1 -1
  33. package/dist/models.js +73 -2
  34. package/dist/models.js.map +1 -1
  35. package/dist/policy.d.ts +3 -0
  36. package/dist/policy.d.ts.map +1 -1
  37. package/dist/proposal-errors.d.ts +4 -0
  38. package/dist/proposal-errors.d.ts.map +1 -1
  39. package/dist/proposals.d.ts +1 -0
  40. package/dist/proposals.d.ts.map +1 -1
  41. package/dist/proposals.js +11 -6
  42. package/dist/proposals.js.map +1 -1
  43. package/dist/redaction.d.ts +9 -0
  44. package/dist/redaction.d.ts.map +1 -0
  45. package/dist/review-dto.d.ts +14 -4
  46. package/dist/review-dto.d.ts.map +1 -1
  47. package/dist/review-host.d.ts.map +1 -1
  48. package/dist/server.d.ts +82 -10
  49. package/dist/server.d.ts.map +1 -1
  50. package/dist/server.js +366 -47
  51. package/dist/server.js.map +1 -1
  52. package/dist/smrt-knowledge.json +124 -18
  53. package/dist/svelte/components/ActionReview.svelte +39 -9
  54. package/dist/svelte/components/ActionReview.svelte.d.ts +8 -1
  55. package/dist/svelte/components/ActionReview.svelte.d.ts.map +1 -1
  56. package/dist/svelte/components/EvidenceViewer.svelte +60 -4
  57. package/dist/svelte/components/EvidenceViewer.svelte.d.ts +12 -1
  58. package/dist/svelte/components/EvidenceViewer.svelte.d.ts.map +1 -1
  59. package/dist/svelte/components/InboxView.svelte +160 -18
  60. package/dist/svelte/components/InboxView.svelte.d.ts +28 -1
  61. package/dist/svelte/components/InboxView.svelte.d.ts.map +1 -1
  62. package/dist/svelte/components/IntakeWorkspace.svelte +27 -0
  63. package/dist/svelte/components/IntakeWorkspace.svelte.d.ts +19 -0
  64. package/dist/svelte/components/IntakeWorkspace.svelte.d.ts.map +1 -0
  65. package/dist/svelte/components/ReviewView.svelte +264 -23
  66. package/dist/svelte/components/ReviewView.svelte.d.ts +18 -1
  67. package/dist/svelte/components/ReviewView.svelte.d.ts.map +1 -1
  68. package/dist/svelte/components/TriageView.svelte +669 -0
  69. package/dist/svelte/components/TriageView.svelte.d.ts +16 -0
  70. package/dist/svelte/components/TriageView.svelte.d.ts.map +1 -0
  71. package/dist/svelte/i18n.d.ts +39 -0
  72. package/dist/svelte/i18n.d.ts.map +1 -1
  73. package/dist/svelte/i18n.js +39 -0
  74. package/dist/svelte/index.d.ts +1 -0
  75. package/dist/svelte/index.d.ts.map +1 -1
  76. package/dist/svelte/index.js +1 -0
  77. package/dist/svelte/view-utils.d.ts +65 -0
  78. package/dist/svelte/view-utils.d.ts.map +1 -1
  79. package/dist/svelte/view-utils.js +145 -0
  80. package/package.json +13 -13
  81. package/dist/chunks/execution-9CfjxX8I.js.map +0 -1
  82. package/dist/chunks/extraction-CJ-zrbg0.js.map +0 -1
  83. package/dist/chunks/feedback-CuUzWKzP.js.map +0 -1
@@ -37,6 +37,34 @@ requires human review; machine authorization requires explicit evaluated opt-ins
37
37
  at all three authority layers and remains separate provenance from human review.
38
38
  The reference handlers always require review; no evaluation claim is made here.
39
39
 
40
+ `operation: 'review_own'` is the submitter-scoped decision gate (#4085). The
41
+ service accepts it only when the host's `authorize` result carries
42
+ `submitter: true`, the resolved policy's `submitterReview` is enabled (the
43
+ application layer opts in; tenant/source layers may only set it `false`), and
44
+ the item's server-recorded `submitter_id` (the receiving service's authenticated
45
+ `scope.actorId`) equals the current actor and the captured
46
+ `execution.principalId`; apply rechecks that a `review_own` decision's reviewer
47
+ is that submitter and principal. All other `review` checks apply
48
+ unchanged; `correct` is refused. The decision row records `mode` and
49
+ `selfDecision` (decider is the submitter, in either mode), and `feedbackEvent` copies them as `decisionMode`/`selfDecision`;
50
+ `authorizeAutomatic` never reads human decisions, so a self-decision cannot
51
+ become automation evidence. `listOwnProposals` reads with the ordinary `read`
52
+ operation per handler after an item-level `read` check. Unreadable items are
53
+ skipped before projection (1000 hidden rows per call, then `Own proposal scan
54
+ limit`) and the cursor names only emitted items with a confirmed readable
55
+ successor. On this surface every host `assertTarget` throw is mapped to the
56
+ exported `IntakeAccessDeniedError` (message `Intake unavailable`, the type of
57
+ every execution denial), so the item becomes an `unavailable` entry and host
58
+ error text is not returned; hosts need no change. Other errors propagate,
59
+ including a throwing grant store in `authorize`. The feedback anti-widening
60
+ check also refuses a re-evaluation that turns `submitterReview` on.
61
+ Deletion redaction blanks `submitter_id` and `owner_key` with the payloads and
62
+ drops `execution.principalId` unless an external action is still `executing`
63
+ or `outcome_unknown`; `finish` and the reconcile state update release it once
64
+ none is left, and later deletion sweeps do the same.
65
+ Hosts whose `authorize` switches exhaustively on the operation fail closed for
66
+ the new value until they opt in.
67
+
40
68
  `mutationBoundary: 'serialized'` is an explicit host guarantee, not an inferred
41
69
  property of a permissions array: grant revocation must serialize with the supplied
42
70
  transaction, or the owning mutation must revalidate under its own lock. The host
@@ -47,6 +75,50 @@ row lock before public `Contents` reads. A current `PrincipalRun` intersects liv
47
75
  permissions with the captured ceiling and checks the exact registered collection
48
76
  operation at every effect. No `runOnce` atomicity is assumed.
49
77
 
78
+ ## Reviewer-chosen actions and dispositions
79
+
80
+ `startAction(StartActionInput)` lets an authenticated reviewer begin any
81
+ operation handler the item's evidence media types offer, without a model
82
+ suggestion. It checks `review` access under that handler before any callback,
83
+ refuses plan handlers and resolved items, binds the current analysis revision's
84
+ completed/partial attempt, inserts an action keyed `reviewer:<requestId>` with
85
+ `data.origin = 'reviewer-selected'`, and reuses `buildBinding`/`publish`: schema
86
+ validation, `validate`, `preview`, exact normalized arguments, target locks,
87
+ evidence pins and the request ledger behave exactly as for `previewProposal`.
88
+ Replays re-preview against the original revision and return the same review.
89
+ Approval, apply, retention, redaction and reconciliation are unchanged.
90
+ `authorizeAutomatic` refuses `reviewer-selected` actions and resolved items;
91
+ human routing is never machine authority.
92
+
93
+ `resolveItem(ResolveItemInput)` appends one terminal `intake_dispositions` row
94
+ (`disposition = 'resolved_no_action'`, reason/reviewer in redactable `data`)
95
+ under the item lock. Reviewer authority is taken from the first handler the
96
+ captured ceiling and policy offer; no new grant exists. It refuses while any
97
+ action is `authorized` with an unexpired approval for its current review
98
+ version, `executing`, `outcome_unknown` or `succeeded`; `failed` actions and
99
+ lapsed approvals do not block it (neither can be rejected). Afterwards
100
+ `submitDecision` refuses everything but `reject`, `publish` refuses any new
101
+ revision (correction, re-preview, plan preview), the apply gate (`approved`)
102
+ refuses any execution or retry, and `IngestionService.analyze`,
103
+ `reviseLogicalSplit` and `createAction` refuse the item under its lock before
104
+ any write. `createAction` (process authority) also refuses the reserved
105
+ `reviewer:` key prefix and `reviewer-selected` origin, which only
106
+ `startReviewerAction` mints; `previewProposal` on such an action requires
107
+ `review` access and the current handler@version. `resolveItem` supersedes
108
+ queued/running analyses and completes dispatch intents under the item lock, and
109
+ `claimAnalysis` returns `null` for a resolved item; `publishProposal` refuses
110
+ a resolved item and any reviewer-selected action. `[feedbackActionTransaction]`
111
+ takes `targetRevisions` (default true); routing lineage re-checks pass false. The feedback context's
112
+ `settled` flag gates selection only; lineage re-checks ignore it (FEEDBACK.md). `intake_dispositions` is a new model: deploy
113
+ its manifest migration (`pnpm ... db:migrate`) before upgrading hosts;
114
+ `assertReady` checks it, and both privacy deletion and retention expiry
115
+ (`redactExecution`) redact its payload with the other item-owned tables.
116
+ `IntakeItemDTO.disposition` is `{ state: 'resolved', at }` (row `created_at`,
117
+ never redacted); `getItemDisposition` returns reviewer and reason under
118
+ `reviewerAccess`. `resolveItem` captures an optional `reviewer_routing` feedback projection in the
119
+ same transaction; a reviewer-selected action is captured when its approval is
120
+ recorded (FEEDBACK.md).
121
+
50
122
  ## Durable review and effects
51
123
 
52
124
  Preview appends a proposal bound to exact analysis attempt/evidence, handler,