@consiliency/agent-board-schema 1.68.0 → 1.74.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 (155) hide show
  1. package/fixtures/already-applied.json +28 -4
  2. package/migrations/20261026000100_agent_board_thread_association.sql +1287 -0
  3. package/migrations/20261101000100_agent_board_session_measured_mint.sql +145 -0
  4. package/migrations/20261104065658_agent_board_reply_delivery.sql +659 -0
  5. package/migrations/20261104170000_agent_board_tasking_replay_scope.sql +320 -0
  6. package/migrations/20261104180000_agent_board_delivery_writer_execute.sql +51 -0
  7. package/migrations/20261104190000_agent_board_message_replay_scope.sql +373 -0
  8. package/package.json +1 -1
  9. package/schema-manifest.json +57 -3
  10. package/src/tooling.test.mjs +8 -2
  11. package/tests/agent_board_661_reply_delivery.test.sql +185 -0
  12. package/tests/agent_board_667_boundary.test.sql +162 -0
  13. package/tests/agent_board_667_conversion_branches.test.sql +91 -0
  14. package/tests/agent_board_667_conversion_profile.test.sql +112 -0
  15. package/tests/agent_board_667_history_class.test.sql +785 -0
  16. package/tests/agent_board_667_native_cast_effect.test.sql +88 -0
  17. package/tests/agent_board_667_realtime_apply_behavior.test.sql +117 -0
  18. package/tests/agent_board_667_realtime_apply_controls.test.sql +143 -0
  19. package/tests/agent_board_667_realtime_apply_profile.test.sql +61 -0
  20. package/tests/agent_board_667_retention.test.sql +201 -0
  21. package/tests/agent_board_667_routing.test.sql +294 -0
  22. package/tests/agent_board_667_sender_effects.test.sql +100 -0
  23. package/tests/agent_board_667_sender_profile_controls.test.sql +29 -0
  24. package/tests/agent_board_667_storage_delimiter_behavior.test.sql +84 -0
  25. package/tests/agent_board_667_storage_delimiter_controls.test.sql +23 -0
  26. package/tests/agent_board_667_storage_delimiter_profile.test.sql +61 -0
  27. package/tests/agent_board_667_storage_search_behavior.test.sql +93 -0
  28. package/tests/agent_board_667_storage_search_controls.test.sql +22 -0
  29. package/tests/agent_board_667_storage_search_profile.test.sql +60 -0
  30. package/tests/agent_board_667_storage_timestamp_behavior.test.sql +58 -0
  31. package/tests/agent_board_667_storage_timestamp_controls.test.sql +22 -0
  32. package/tests/agent_board_667_storage_timestamp_profile.test.sql +54 -0
  33. package/tests/agent_board_667_writers.test.sql +281 -0
  34. package/tests/agent_board_717_message_replay_scope.test.sql +828 -0
  35. package/tests/agent_board_717_tasking_replay_scope.test.sql +661 -0
  36. package/tests/agent_board_addressing.test.sql +8 -5
  37. package/tests/agent_board_claim_subject_gate.test.sql +7 -3
  38. package/tests/agent_board_claimpolicy_race.test.sql +39 -11
  39. package/tests/agent_board_delegate_role_class.test.sql +33 -15
  40. package/tests/agent_board_delivery_writer_execute.test.sql +371 -0
  41. package/tests/agent_board_fk_lock_edges.test.sql +3 -0
  42. package/tests/agent_board_hosted_delegates.test.sql +5 -2
  43. package/tests/agent_board_inbox_rpcs.test.sql +5 -3
  44. package/tests/agent_board_obsgate.test.sql +8 -4
  45. package/tests/agent_board_obsgate4.test.sql +2 -2
  46. package/tests/agent_board_outbox_wake_ordering.test.sql +25 -2
  47. package/tests/agent_board_own_post_not_delivered.test.sql +11 -9
  48. package/tests/agent_board_session_identity_behavior_classes.test.sql +2 -2
  49. package/tests/agent_board_session_identity_limits.test.sql +1 -1
  50. package/tests/agent_board_session_identity_measured_mint.test.sql +342 -0
  51. package/tests/agent_board_session_identity_predicate_isolation.test.sql +146 -0
  52. package/tests/agent_board_sidserver_authority.test.sql +69 -0
  53. package/tests/agent_board_sidserver_catalog.test.sql +47 -0
  54. package/tests/agent_board_signed_write_gateway.test.sql +4 -2
  55. package/tests/agent_board_task_thread_lock_order.test.sql +67 -42
  56. package/tests/agent_board_v2_invariants.test.sql +5 -2
  57. package/tests/agent_board_write_enforcement_class.test.sql +3 -3
  58. package/tests/catalog/function_execute_privileges.json +41 -5
  59. package/tests/catalog/p_metadata_parameters.json +16 -0
  60. package/tests/fixtures/agent_board_667_apply_rls_guard.sql +195 -0
  61. package/tests/fixtures/agent_board_667_apply_rls_provenance.md +125 -0
  62. package/tests/fixtures/agent_board_667_apply_rls_reference.sql +1903 -0
  63. package/tests/fixtures/agent_board_667_conversion_guard.sql +162 -0
  64. package/tests/fixtures/agent_board_667_conversion_reference.md +23 -0
  65. package/tests/fixtures/agent_board_667_conversion_reference.sql +5325 -0
  66. package/tests/fixtures/agent_board_667_delimiter_guard.sql +92 -0
  67. package/tests/fixtures/agent_board_667_delimiter_provenance.md +116 -0
  68. package/tests/fixtures/agent_board_667_delimiter_reference.sql +10150 -0
  69. package/tests/fixtures/agent_board_667_search_guard.sql +92 -0
  70. package/tests/fixtures/agent_board_667_search_provenance.md +141 -0
  71. package/tests/fixtures/agent_board_667_search_reference.sql +4779 -0
  72. package/tests/fixtures/agent_board_667_sender_guard.sql +102 -0
  73. package/tests/fixtures/agent_board_667_sender_reference.md +20 -0
  74. package/tests/fixtures/agent_board_667_sender_reference.sql +875 -0
  75. package/tests/fixtures/agent_board_667_timestamp_graph.sql +84 -0
  76. package/tests/fixtures/agent_board_667_timestamp_guard.sql +94 -0
  77. package/tests/fixtures/agent_board_667_timestamp_provenance.md +99 -0
  78. package/tests/fixtures/agent_board_667_timestamp_reference.sql +2938 -0
  79. package/tests/isolation/expected/association_artifact_anchor_order.out +108 -0
  80. package/tests/isolation/expected/association_board_vs_board.out +71 -0
  81. package/tests/isolation/expected/association_post_wait_authority.out +77 -0
  82. package/tests/isolation/expected/association_strong_history_writers.out +203 -0
  83. package/tests/isolation/expected/association_strong_isolation.out +185 -0
  84. package/tests/isolation/expected/association_vs_artifact_claim_escalation.out +199 -0
  85. package/tests/isolation/expected/association_vs_heartbeat.out +78 -0
  86. package/tests/isolation/expected/association_vs_multi_anchor_artifact.out +67 -0
  87. package/tests/isolation/expected/association_vs_private_message.out +67 -0
  88. package/tests/isolation/expected/association_vs_task_and_conflict.out +133 -0
  89. package/tests/isolation/expected/association_vs_taskful_cross_thread.out +133 -0
  90. package/tests/isolation/expected/message_replay_scope.out +209 -0
  91. package/tests/isolation/expected/tasking_replay_scope.out +125 -0
  92. package/tests/isolation/specs/association_artifact_anchor_order.spec +46 -0
  93. package/tests/isolation/specs/association_board_vs_board.spec +37 -0
  94. package/tests/isolation/specs/association_post_wait_authority.spec +48 -0
  95. package/tests/isolation/specs/association_strong_history_writers.spec +61 -0
  96. package/tests/isolation/specs/association_strong_isolation.spec +50 -0
  97. package/tests/isolation/specs/association_vs_artifact_claim_escalation.spec +41 -0
  98. package/tests/isolation/specs/association_vs_heartbeat.spec +47 -0
  99. package/tests/isolation/specs/association_vs_multi_anchor_artifact.spec +38 -0
  100. package/tests/isolation/specs/association_vs_private_message.spec +33 -0
  101. package/tests/isolation/specs/association_vs_task_and_conflict.spec +38 -0
  102. package/tests/isolation/specs/association_vs_taskful_cross_thread.spec +42 -0
  103. package/tests/isolation/specs/message_replay_scope.spec +77 -0
  104. package/tests/isolation/specs/tasking_replay_scope.spec +72 -0
  105. package/tests/mutations/717-f1/M0_prefix_main_acl_and_comments.sql +11 -0
  106. package/tests/mutations/717-f1/M10_wrapper_stops_delegating.sql +7 -0
  107. package/tests/mutations/717-f1/M11_transitive_recipient_content.sql +8 -0
  108. package/tests/mutations/717-f1/M12_transitive_recipient_visibility.sql +8 -0
  109. package/tests/mutations/717-f1/M13_transitive_worker_content.sql +15 -0
  110. package/tests/mutations/717-f1/M1a_regrant_upsert_delivery_recipient.sql +1 -0
  111. package/tests/mutations/717-f1/M1b_regrant_upsert_inbox_item.sql +1 -0
  112. package/tests/mutations/717-f1/M1c_regrant_queue_inbox_callbacks.sql +1 -0
  113. package/tests/mutations/717-f1/M1d_regrant_queue_board_post_callbacks.sql +1 -0
  114. package/tests/mutations/717-f1/M1e_regrant_next_thread_message_sequence.sql +1 -0
  115. package/tests/mutations/717-f1/M2_blanket_schema_grant.sql +1 -0
  116. package/tests/mutations/717-f1/M3_new_overload_of_sink.sql +10 -0
  117. package/tests/mutations/717-f1/M4_new_route_calling_sink.sql +7 -0
  118. package/tests/mutations/717-f1/M5_actor_trusts_supplied_id.sql +5 -0
  119. package/tests/mutations/717-f1/M6_signed_route_granted_to_authenticated.sql +1 -0
  120. package/tests/mutations/717-f1/M7_worker_granted_to_authenticated.sql +1 -0
  121. package/tests/mutations/717-f1/M8_recipient_state_rewrites_visibility.sql +5 -0
  122. package/tests/mutations/717-f1/M9_public_route_revoked_from_service_role.sql +1 -0
  123. package/tests/mutations/717-f1/outbox_wake_ordering/W1_regrant_queue_inbox_callbacks.sql +1 -0
  124. package/tests/mutations/717-f1/outbox_wake_ordering/W2_revoke_worker_from_service_role.sql +1 -0
  125. package/tests/mutations/717-f1/outbox_wake_ordering/W3_invoker_caller_of_sink.sql +1 -0
  126. package/tests/mutations/717-f1/outbox_wake_ordering/W4_public_regrant_board_post_sink.sql +1 -0
  127. package/tests/mutations/717-f1/run.sh +17 -0
  128. package/tests/mutations/717-f2b/C1_new_delivery_route.sql +4 -0
  129. package/tests/mutations/717-f2b/C2_new_replay_lookup.sql +3 -0
  130. package/tests/mutations/717-f2b/C3_internal_regranted.sql +2 -0
  131. package/tests/mutations/717-f2b/C4_wrapper_writes_delivery.sql +9 -0
  132. package/tests/mutations/717-f2b/C5_class_member_dynamic_sql.sql +9 -0
  133. package/tests/mutations/717-f2b/C6_drop_board_scope_constraint.sql +2 -0
  134. package/tests/mutations/717-f2b/C7_state_private_helper_content.sql +14 -0
  135. package/tests/mutations/717-f2b/L1_dm_lock_split_by_recipient.sql +8 -0
  136. package/tests/mutations/717-f2b/L2_dm_lock_removed.sql +12 -0
  137. package/tests/mutations/717-f2b/L3_mc_lock_split_by_recipients.sql +8 -0
  138. package/tests/mutations/717-f2b/L4_mc_lock_removed.sql +12 -0
  139. package/tests/mutations/717-f2b/M0_prefix_definitions.sql +17 -0
  140. package/tests/mutations/717-f2b/M10_mc_lookup_any_author.sql +15 -0
  141. package/tests/mutations/717-f2b/M11_dm_swallow_refusal.sql +8 -0
  142. package/tests/mutations/717-f2b/M12_mc_swallow_refusal.sql +8 -0
  143. package/tests/mutations/717-f2b/M13_signed_dm_swallows_refusal.sql +32 -0
  144. package/tests/mutations/717-f2b/M14_signed_mc_swallows_refusal.sql +20 -0
  145. package/tests/mutations/717-f2b/M15_mc_any_source.sql +7 -0
  146. package/tests/mutations/717-f2b/M1_dm_drop_recipient_proof.sql +16 -0
  147. package/tests/mutations/717-f2b/M2_mc_drop_recipient_proof.sql +16 -0
  148. package/tests/mutations/717-f2b/M3_dm_metadata_as_proof.sql +12 -0
  149. package/tests/mutations/717-f2b/M4_mc_metadata_as_proof.sql +16 -0
  150. package/tests/mutations/717-f2b/M5_dm_any_mode.sql +11 -0
  151. package/tests/mutations/717-f2b/M6_dm_board_delivery_counts.sql +11 -0
  152. package/tests/mutations/717-f2b/M7_mc_any_mode.sql +11 -0
  153. package/tests/mutations/717-f2b/M8_dm_thread_stamp_as_proof.sql +12 -0
  154. package/tests/mutations/717-f2b/M9_dm_lookup_any_author.sql +15 -0
  155. package/tests/mutations/717-f2b/run.sh +82 -0
@@ -0,0 +1,92 @@
1
+ -- Requires the reviewed conversion/sender/timestamp/search helpers in this transaction.
2
+ -- This admits one exact delimiter OID; it is not a Storage reader exemption.
3
+ \ir agent_board_667_delimiter_reference.sql
4
+ create function pg_temp.xb_sd_prerequisite_problems() returns table(identity text,problem text)
5
+ language sql volatile set search_path=pg_catalog as $$
6
+ select identity,problem from pg_temp.xb_ss_problems()
7
+ union all select r.identity,'delimiter declaration or security drift' from pg_temp.xb_sd_reference r
8
+ where r.kind='wrapper' and r.payload is distinct from pg_temp.xb_cf_meta(to_regprocedure(r.identity))
9
+ union all select pg_temp.xb_cf_fn(p.oid),'unreviewed delimiter overload or shadow' from pg_proc p
10
+ where p.proname in(select payload#>>'{}' from pg_temp.xb_sd_reference where kind='name')
11
+ and not exists(select 1 from pg_temp.xb_sd_reference r where r.kind='resolution' and to_regprocedure(r.identity)=p.oid)
12
+ union all select r.identity,'delimiter resolution declaration drift' from pg_temp.xb_sd_reference r
13
+ where r.kind='resolution' and r.payload is distinct from
14
+ case when (select prokind from pg_proc where oid=to_regprocedure(r.identity))='a'
15
+ then pg_temp.xb_st_aggregate(to_regprocedure(r.identity)) else pg_temp.xb_cf_meta(to_regprocedure(r.identity)) end
16
+ $$;
17
+ create temp table xb_sd_views(rel oid primary key,identity text not null,category text not null) on commit drop;
18
+ do $graph$
19
+ declare q record; nm text;
20
+ begin
21
+ if not exists(select 1 from pg_temp.xb_sd_prerequisite_problems()) then
22
+ for q in select identity,payload from pg_temp.xb_sd_reference where kind='query' order by identity loop
23
+ nm:='xb_sd_'||q.identity;
24
+ execute format('create temp view %I as %s',nm,q.payload->>'sql');
25
+ insert into pg_temp.xb_sd_views values(to_regclass('pg_temp.'||nm),q.identity,q.payload->>'group');
26
+ end loop;
27
+ end if;
28
+ end $graph$;
29
+ create function pg_temp.xb_sd_roots() returns table(fn oid)
30
+ language sql volatile set search_path=pg_catalog as $$
31
+ select d.refobjid from pg_temp.xb_sd_views v join pg_rewrite w on w.ev_class=v.rel
32
+ join pg_depend d on d.classid='pg_rewrite'::regclass and d.objid=w.oid where d.refclassid='pg_proc'::regclass
33
+ union select m[2]::oid from pg_temp.xb_sd_views v join pg_rewrite w on w.ev_class=v.rel
34
+ cross join lateral regexp_matches(w.ev_action::text,':(funcid|aggfnoid|winfnoid|opfuncid|elemfuncid) ([0-9]+)','g') m
35
+ where m[2]::oid<>0
36
+ union select fn from pg_temp.xb_st_roots() where origin like 'target %'
37
+ $$;
38
+ create function pg_temp.xb_sd_reach() returns table(fn oid)
39
+ language sql volatile set search_path=pg_catalog as $$
40
+ with recursive edges(source,target) as (
41
+ select p.oid,p.prosupport::oid from pg_proc p where p.prosupport<>0
42
+ union select d.objid,d.refobjid from pg_depend d where d.classid='pg_proc'::regclass and d.refclassid='pg_proc'::regclass
43
+ union select aggregate,fn from pg_temp.xb_st_aggregate_slots()
44
+ ), reach(fn) as (select fn from pg_temp.xb_sd_roots() union select e.target from reach r join edges e on e.source=r.fn)
45
+ select fn from reach
46
+ $$;
47
+ create function pg_temp.xb_sd_collations() returns table(coll oid)
48
+ language sql volatile set search_path=pg_catalog as $$
49
+ select distinct m[1]::oid from pg_temp.xb_sd_views v join pg_rewrite w on w.ev_class=v.rel
50
+ cross join lateral regexp_matches(w.ev_action::text,':(?:inputcollid|collid|varcollid|constcollid|opcollid|funccollid) ([0-9]+)','g') m
51
+ where m[1]::oid<>0
52
+ union select coll from pg_temp.xb_st_collations()
53
+ $$;
54
+ create function pg_temp.xb_sd_problems() returns table(identity text,problem text)
55
+ language sql volatile set search_path=pg_catalog as $$
56
+ select identity,problem from pg_temp.xb_sd_prerequisite_problems()
57
+ union all select 'delimiter parser inventory','query inventory incomplete'
58
+ where (select count(*) from pg_temp.xb_sd_views)<>(select count(*) from pg_temp.xb_sd_reference where kind='query')
59
+ union all select r.identity,'parsed group incomplete' from pg_temp.xb_sd_reference r where r.kind='group'
60
+ and (select count(*) from pg_temp.xb_sd_views v where v.category=r.identity)<>(r.payload#>>'{}')::integer
61
+ union all select pg_temp.xb_cf_fn(g.fn),'unreviewed delimiter executable or support callback' from pg_temp.xb_sd_reach() g
62
+ where not exists(select 1 from pg_temp.xb_sd_reference r where r.kind in('primitive','helper','aggregate') and to_regprocedure(r.identity)=g.fn)
63
+ union all select r.identity,'delimiter primitive or helper declaration drift' from pg_temp.xb_sd_reference r
64
+ where r.kind in('primitive','helper') and r.payload is distinct from pg_temp.xb_cf_meta(to_regprocedure(r.identity))
65
+ union all select r.identity,'delimiter aggregate dispatch drift' from pg_temp.xb_sd_reference r
66
+ where r.kind='aggregate' and r.payload is distinct from pg_temp.xb_st_aggregate(to_regprocedure(r.identity))
67
+ union all select n.nspname||'.'||c.collname,'unreviewed delimiter collation' from pg_temp.xb_sd_collations() x
68
+ join pg_collation c on c.oid=x.coll join pg_namespace n on n.oid=c.collnamespace
69
+ where not exists(select 1 from pg_temp.xb_sd_reference r where r.kind='collation'
70
+ and r.identity=format('%I.%I',n.nspname,c.collname) and r.payload=pg_temp.xb_st_collation(c.oid))
71
+ union all select d.refobjid::regclass::text,'unexpected delimiter relation' from pg_temp.xb_sd_views v
72
+ join pg_rewrite w on w.ev_class=v.rel join pg_depend d on d.classid='pg_rewrite'::regclass and d.objid=w.oid
73
+ where d.refclassid='pg_class'::regclass and d.refobjid not in(v.rel,to_regclass('storage.objects'))
74
+ -- The normalization parser binds v_current to the reviewed objects row type.
75
+ -- Prove that binding against every actual parsed batch projection and every
76
+ -- field discovered in the source, not an assumed record-column list.
77
+ union all select v.identity||'.'||field,'delimiter record anchor type drift'
78
+ from pg_temp.xb_sd_views v join pg_temp.xb_sd_reference q on q.kind='query' and q.identity=v.identity
79
+ cross join lateral (select jsonb_array_elements_text(payload->'record_fields') as field
80
+ from pg_temp.xb_sd_reference where kind='coverage') f
81
+ left join pg_attribute a on a.attrelid=v.rel and a.attname=f.field and a.attnum>0 and not a.attisdropped
82
+ left join pg_attribute target on target.attrelid=to_regclass('storage.objects') and target.attname=f.field
83
+ and target.attnum>0 and not target.attisdropped
84
+ where q.payload->>'role'='record' and (a.attname is null or target.attname is null
85
+ or row(a.atttypid,a.atttypmod,a.attcollation) is distinct from row(target.atttypid,target.atttypmod,target.attcollation))
86
+ $$;
87
+ create function pg_temp.xb_sd_admitted() returns table(fn oid)
88
+ language sql volatile set search_path=pg_catalog as $$
89
+ select to_regprocedure(identity)::oid from pg_temp.xb_sd_reference where kind='wrapper'
90
+ and identity='storage.list_objects_with_delimiter(text,text,text,integer,text,text,text,text,text,timestamp with time zone,text)'
91
+ and not exists(select 1 from pg_temp.xb_sd_problems())
92
+ $$;
@@ -0,0 +1,116 @@
1
+ # Finite delimiter-reader effect disposition
2
+
3
+ This proof covers only
4
+ `storage.list_objects_with_delimiter(text,text,text,integer,text,text,text,text,text,timestamp with time zone,text)`.
5
+ It is separate from the timestamp and search readers. `realtime.apply_rls` remains
6
+ unadmitted. A missing native wrapper gives no native behavior or effect credit.
7
+
8
+ The reference input is the retained full Supabase CI catalog for `e2770539`,
9
+ SHA-256 `9582cf9fce0dd7ec70ad5f16bbca3c906aa5d9312a540348a251306f79241aca`.
10
+ The captured delimiter declaration has MD5 `7747efec8583d78cd01449d9b99cd2eb`.
11
+ The owned PostgreSQL 17.11.0.004 preparation matched that declaration, owner and
12
+ ACL. Native CI on the candidate must establish the additional profile equality
13
+ with its 17.11.0.006 installation. Declaration equality is not C binary attestation.
14
+
15
+ ## Source inventory and call closure
16
+
17
+ The existing bounded source interpreter is reused unchanged. The exact native
18
+ body has three dynamic execution sites with 18, 324 and 324 non-null constructor
19
+ alternatives, ten static SELECTs and 166 scalar expressions: 842 parser views.
20
+ The inventory includes initializers, assignments, branch selectors/conditions,
21
+ EXIT conditions, USING expressions, constructor expressions and RAISE arguments.
22
+ Two execution sites have an additional null alternative, which PostgreSQL refuses
23
+ with `22004`; null is never converted into executable caller text. Ignoring exits
24
+ over-approximates possible later construction. SQL constructor assignments inside
25
+ loops and unclassified statement forms remain refused by the interpreter. The
26
+ present body uses only bare RETURN/RETURN NEXT; completeness for another body is
27
+ not claimed.
28
+
29
+ These are source-derived parser inputs, not runtime branch coverage or a sample
30
+ of argument strings. All caller prefixes, delimiters and cursors remain typed
31
+ bound data. Branch merging includes unreachable constructor combinations. Record
32
+ expressions bind the ten source-discovered `v_current` fields to `storage.objects`;
33
+ the guard positively checks every field's type, modifier and collation against
34
+ all 324 actual parsed batch projections.
35
+
36
+ The graph combines `pg_depend` with stored parser-node callable OIDs, including
37
+ pinned builtins omitted from normal dependencies. It follows callable dependency
38
+ and support edges and the existing aggregate callback census. This reader reaches
39
+ no aggregate; a newly reached one requires a new disposition. Parsed relations
40
+ must be their own view or the fixed `storage.objects` target. Resolution profiles
41
+ cover all catalog overloads/shadows for every reached callable name. A changed
42
+ declaration, collation, executable or target prevents admission by exact OID.
43
+
44
+ The delimiter prerequisite composes the earlier search, timestamp, sender and
45
+ conversion proofs. Consequently target columns, defaults, constraints, indexes,
46
+ owner/ACL, schema access, policies, rewrite rules, inheritance and registered
47
+ type/output/operator/opfamily dispatch remain guarded. Source preparation does
48
+ not add entries to any earlier reference. The reference generator requires every
49
+ reached primitive to match an earlier reviewed search primitive, except the one
50
+ newly reviewed timestamp entry point below. It cannot enroll an arbitrary
51
+ `pg_catalog` or C/internal function merely because of its namespace or language.
52
+
53
+ ## Newly reached timestamp primitive
54
+
55
+ There are 25 reached primitive identities and the composed SQL prefix helper.
56
+ Twenty-four primitive dispositions are inherited byte-for-byte from the reviewed
57
+ search reference. The sole new primitive is
58
+ `pg_catalog.date_trunc(text,timestamp with time zone)`, internal entry point
59
+ `timestamptz_trunc`. The exact delimiter source contains 19 calls, each with the
60
+ literal unit `milliseconds`; callers cannot select the unit or implementation.
61
+
62
+ The implementation was read from PostgreSQL's `REL_17_11` sources:
63
+
64
+ - [`timestamptz_trunc` and its internal implementation](https://github.com/postgres/postgres/blob/REL_17_11/src/backend/utils/adt/timestamp.c#L4838)
65
+ use the session timezone to decode a finite timestamp, truncate the fractional
66
+ second with integer arithmetic, and convert it back. Infinite timestamps return
67
+ unchanged. The millisecond branch does not request timezone-offset recomputation.
68
+ - [`DecodeUnits`](https://github.com/postgres/postgres/blob/REL_17_11/src/backend/utils/adt/datetime.c)
69
+ and the identifier normalization in
70
+ [`scansup.c`](https://github.com/postgres/postgres/blob/REL_17_11/src/backend/parser/scansup.c)
71
+ classify the fixed unit. Timestamp conversion reads backend timezone state and
72
+ [`timezone implementation data`](https://github.com/postgres/postgres/blob/REL_17_11/src/timezone/localtime.c).
73
+
74
+ Those paths allocate, read backend/timezone data and may raise errors; this is not
75
+ a claim of no effects at all. Within the reviewed implementation they introduce
76
+ no SQL callback or application thread-history DML. The existing finite dispatch
77
+ proof remains a premise for the other reached primitives and their callbacks.
78
+ Upstream source inspection does not attest the deployed PostgreSQL or locale
79
+ binaries, arbitrary extension hooks, or arbitrary privileged SQL.
80
+
81
+ ## Witnesses and recording boundaries
82
+
83
+ The behavior fixture uses a fresh own bucket, a separate decoy bucket, versioned
84
+ objects, two archived rows within one millisecond, an interleaved deletion marker,
85
+ and nested names. It checks full leaf/folder fields, ascending and descending
86
+ results, empty delimiter, nested prefix, start-after and next-token precedence,
87
+ limits, version/marker modes, the timestamp-plus-version cursor, literal SQL-looking
88
+ data, service visibility and authenticated RLS refusal. Version ties sort ASC in
89
+ the captured source. An initial fixture assumed DESC; its four failed assertions
90
+ are retained without verification credit. The corrected fixture pins the actual
91
+ source contract, including resuming from version `a` to `b` in the same millisecond.
92
+
93
+ Profile/control tests separately check all inventory groups, the timestamp
94
+ primitive, constructor and SQL-helper roots, every typed record projection, the
95
+ fixed relation, null-execution refusal, and an injected overload. Removing the new overload census fails its named census
96
+ assertion while an inherited guard still refuses admission; that witness receives
97
+ no separate refusal credit. A SELECT with a
98
+ live INSERT trigger has zero trigger effects, and an explicit own INSERT invokes
99
+ that same trigger. A real SELECT-policy callback demonstrates that STABLE alone
100
+ cannot establish absence of writes; the policy remains unadmitted.
101
+
102
+ Mutation receipts must retain actual full reader source and `pg_proc` metadata
103
+ before every phase, including passing phases, full plans and exact named failures.
104
+ Post-rollback readbacks compare the same-owned-database baseline: reader/source,
105
+ all policies, every Storage rule/relation/attribute/default/index/constraint,
106
+ inheritance and non-temporary namespace rows, the global persistent-function
107
+ census and SHA-256, and a separate temporary-function census. This is scoped
108
+ semantic restoration; physical statistics, file numbers, vacuum horizons and
109
+ temporary namespace allocation are not claimed restored. Setup failures and
110
+ surviving mutations receive no credit. Repeated phases do not add distinct-family
111
+ credit. Each allow call uses `lives_ok` followed by a separate state assertion.
112
+
113
+ The manual generator accepts retained native and owned parser catalogs, writes
114
+ only with explicit `--output`, and otherwise checks the checked-in reference.
115
+ There is no live production query or automatic reference refresh. New source,
116
+ dispatch or primitive effects require review before updating the reference.