Skip to content
Draft
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
788873a
test(integration): require durable delivery attempt admission
seonghobae Sep 8, 2026
3ae5cf3
feat(integration): add delivery attempt admission aggregate
seonghobae Sep 8, 2026
edbe29c
feat(integration): persist delivery attempt admission
seonghobae Sep 8, 2026
2c96ec9
feat(integration): add PostgreSQL delivery attempt store
seonghobae Sep 8, 2026
145da39
test(integration): cover delivery attempt PostgreSQL admission
seonghobae Sep 8, 2026
7a2efc7
test(integration): prove durable delivery attempt authority fence
seonghobae Sep 8, 2026
a9227ec
ci(integration): prove delivery attempt admission RED to GREEN
seonghobae Sep 8, 2026
b97f74c
test(integration): type delivery attempt SQL fixtures exactly
seonghobae Sep 8, 2026
d9bf338
test(integration): require fresh-snapshot delivery replay
seonghobae Sep 8, 2026
91808f1
fix(integration): re-read concurrent delivery replay
seonghobae Sep 8, 2026
8c47ded
test(integration): align delivery replay evidence cases
seonghobae Sep 8, 2026
027840b
ci(integration): prove concurrent delivery replay RED
seonghobae Sep 8, 2026
5d667b8
ci(integration): pin PostgreSQL verifier image
seonghobae Sep 8, 2026
41e8df4
ci(integration): repair delivery attempt verifier formatting lane
seonghobae Sep 8, 2026
3e0c8b9
style(integration): canonicalize delivery attempt sources
github-actions[bot] Sep 8, 2026
db74bfe
ci(integration): verify canonical delivery-attempt head
seonghobae Sep 8, 2026
f476386
test(integration): bound hostile delivery attempt envelopes
seonghobae Sep 8, 2026
912958f
fix(integration): bound delivery attempt authority accessors
seonghobae Sep 8, 2026
d5e8924
chore(integration): adopt repaired PostgreSQL runtime parent
seonghobae Sep 8, 2026
1d4c89d
test(integration): bound delivery attempt dependency failures
seonghobae Sep 8, 2026
5d290b5
ci(integration): repair delivery attempt verifier formatting path
seonghobae Sep 8, 2026
91c5ebc
style(integration): format delivery attempt dependency regression
seonghobae Sep 8, 2026
56fa632
style(integration): format delivery attempt dependency regression
github-actions[bot] Sep 8, 2026
987f0a8
ci(integration): make delivery verifier proof-only
seonghobae Sep 8, 2026
c6330c0
fix(integration): bound delivery attempt dependency failures
seonghobae Sep 8, 2026
aac83fc
chore(integration): retire delivery attempt verifier
seonghobae Sep 8, 2026
8ef43e1
test(integration): expose delivery attempt timestamp drift
seonghobae Sep 8, 2026
7713765
test(integration): expose delivery database target policy
seonghobae Sep 8, 2026
9f2d9b7
test(integration): reject unsafe delivery database targets
seonghobae Sep 8, 2026
c77d0a3
test(integration): require delivery attempt database contract comment
seonghobae Sep 8, 2026
5bfdee3
fix(integration): preserve delivery attempt schedule timestamps
seonghobae Sep 8, 2026
aca4c3b
fix(integration): bound destructive PostgreSQL test targets
seonghobae Sep 8, 2026
da94bb6
fix(integration): preserve PostgreSQL test transport policy
seonghobae Sep 8, 2026
171f15e
docs(integration): declare delivery attempt persistence contract
seonghobae Sep 8, 2026
dfb76e3
ci(integration): prove delivery attempt review repairs
seonghobae Sep 8, 2026
8ff4187
style(integration): canonicalize delivery test target helper
seonghobae Sep 8, 2026
c942f06
style(integration): wrap delivery test target type
seonghobae Sep 8, 2026
308dd97
style(integration): canonicalize delivery target policy tests
seonghobae Sep 8, 2026
87b247f
test(integration): cover delivery test target edge policy
seonghobae Sep 8, 2026
7396754
fix(integration): accept IPv6 loopback test targets
seonghobae Sep 8, 2026
7cb400d
ci(integration): prove IPv6 loopback review edge
seonghobae Sep 8, 2026
e8e2954
style(integration): canonicalize PostgreSQL policy import
seonghobae Sep 8, 2026
b0cb07c
chore(actions): repair delivery review formatting once
seonghobae Sep 8, 2026
777f283
style(integration): canonicalize delivery review tests
github-actions[bot] Sep 8, 2026
9e6e88e
fix(actions): make delivery review proof directly dispatchable
seonghobae Sep 8, 2026
cbb3caa
chore(actions): retire delivery review verifier
seonghobae Sep 8, 2026
b390f37
test(integration): reject hostile delivery-attempt SQL evidence getters
seonghobae Sep 8, 2026
e9a8b21
fix(integration): bound hostile delivery-attempt SQL evidence
seonghobae Sep 8, 2026
ec2353a
ci(integration): verify hostile delivery-attempt SQL evidence repair
seonghobae Sep 8, 2026
fe51a79
docs(changelog): record bounded delivery-attempt SQL evidence
seonghobae Sep 8, 2026
9ed7847
chore(integration): retire hostile SQL evidence verifier
seonghobae Sep 8, 2026
ec614ef
test(integration): reject changing SQL row collections
seonghobae Sep 15, 2026
f254e59
ci(integration): verify SQL row collection evidence
seonghobae Sep 15, 2026
e563516
fix(integration): snapshot SQL row collection evidence
seonghobae Sep 15, 2026
273ece8
docs(integration): document delivery attempt authority helpers
seonghobae Sep 16, 2026
2313688
docs(integration): document delivery attempt persistence helpers
seonghobae Sep 16, 2026
72e34e2
fix(ci): bootstrap pnpm after Node setup
seonghobae Sep 16, 2026
882a57e
test(integration): reject revoked delivery SQL evidence
seonghobae Sep 16, 2026
7c6986d
fix(integration): bound revoked delivery SQL evidence
seonghobae Sep 16, 2026
d3dcb6e
test(integration): reject revoked delivery authority shapes
seonghobae Sep 16, 2026
e6e8d7f
fix(integration): bound revoked delivery authority shapes
seonghobae Sep 16, 2026
3a81bae
test(ci): verify delivery authority hostile shapes
seonghobae Sep 16, 2026
039e5f9
ci(integration): diagnose delivery attempt formatting
seonghobae Sep 17, 2026
9c7ab05
fix(ci): focus delivery attempt hostile verifier
seonghobae Sep 17, 2026
5baff84
ci(integration): bind formatting diagnostic to exact heads
seonghobae Sep 17, 2026
2a31004
ci(integration): harden delivery attempt verifier checkout
seonghobae Sep 17, 2026
a4b7191
style(integration): apply delivery attempt formatting
seonghobae Sep 17, 2026
35be2d6
style(integration): format delivery attempt evidence read
seonghobae Sep 17, 2026
b9deda8
style(integration): format delivery attempt authority tests
seonghobae Sep 17, 2026
5f5c118
ci(integration): retire delivery attempt formatter diagnostic
seonghobae Sep 17, 2026
a2431d2
test(integration): keep hostile SQL result inside promise boundary
seonghobae Sep 17, 2026
e40fc9c
test(integration): simplify hostile result accessor fixture
seonghobae Sep 17, 2026
e67fa3d
ci(integration): retire row collection verifier
seonghobae Sep 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/diagnose-plugin-delivery-attempt-formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Diagnose plugin delivery attempt formatting

on:
push:
branches:
- feat/plugin-delivery-attempt-lifecycle-v1

permissions:
contents: read

jobs:
diagnose:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout exact branch head
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 1
persist-credentials: false
ref: ${{ github.sha }}
- name: Set up Node 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
with:
node-version: '24'
- name: Install frozen workspace
shell: bash
run: |
set -Eeuo pipefail
corepack enable
pnpm install --frozen-lockfile
- name: Print canonical delivery-attempt formatting patch
shell: bash
run: |
set -Eeuo pipefail
pnpm exec prettier --write \
apps/integration-service/src/plugin-delivery-attempt-repository.ts \
apps/integration-service/src/plugin-delivery-attempt-repository-hostile-collection.test.ts \
apps/integration-service/src/plugin-delivery-attempt.ts \
apps/integration-service/src/plugin-delivery-attempt.test.ts
git --no-pager diff --check
git --no-pager diff -- \
apps/integration-service/src/plugin-delivery-attempt-repository.ts \
apps/integration-service/src/plugin-delivery-attempt-repository-hostile-collection.test.ts \
apps/integration-service/src/plugin-delivery-attempt.ts \
apps/integration-service/src/plugin-delivery-attempt.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Verify Plugin Delivery Attempt Row Collection

on:
push:
branches:
- feat/plugin-delivery-attempt-lifecycle-v1

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Checkout exact branch head
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 1
persist-credentials: false
ref: ${{ github.sha }}
- name: Set up Node 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
with:
node-version: '24'
- name: Enable repository pnpm
run: corepack enable
- name: Install frozen workspace
run: pnpm install --frozen-lockfile
- name: Check focused formatting
run: >-
pnpm exec prettier --check
apps/integration-service/src/plugin-delivery-attempt-repository.ts
apps/integration-service/src/plugin-delivery-attempt-repository-hostile-collection.test.ts
apps/integration-service/src/plugin-delivery-attempt.ts
apps/integration-service/src/plugin-delivery-attempt.test.ts
- name: Run hostile row collection regression
run: pnpm --filter @life-os/integration-service test plugin-delivery-attempt-repository-hostile-collection.test.ts
- name: Run hostile application authority regression
run: pnpm --filter @life-os/integration-service test plugin-delivery-attempt.test.ts
- name: Typecheck Integration
run: pnpm --filter @life-os/integration-service typecheck
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ All notable changes to LifeOS are documented in this file.

### Fixed

- Plugin delivery-attempt PostgreSQL persistence now treats returned result envelopes, durable row fields, and stored timestamp conversion as untrusted evidence, collapsing throwing accessors into the fixed credential-free `PluginDeliveryAttemptPersistenceEvidenceError` instead of allowing native dependency detail to escape.
- Plugin credential replay now revalidates the exact durable credential binding after provider-backed secret verification and installation revalidation, so a concurrent credential revocation cannot be returned as stale active replay authority.
- Plugin credential replay now revalidates the owning installation after provider-backed secret verification; a concurrent installation revocation cannot leave stale active replay metadata accepted after secret-store I/O.
- Plugin credential metadata replays now require exact provider-backed secret evidence before acceptance; reusing a binding identity with different secret bytes, or with missing/conflicting Vault evidence, fails closed instead of returning stale active metadata.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
CREATE TABLE plugin_integration.plugin_delivery_attempt_record (
authority_version text NOT NULL,
delivery_id uuid PRIMARY KEY,
grant_id uuid NOT NULL,
installation_id uuid NOT NULL,
workspace_id uuid NOT NULL,
requested_by_user_id uuid NOT NULL,
delivery_status text NOT NULL DEFAULT 'pending',
attempt_count smallint NOT NULL DEFAULT 0,
max_attempts smallint NOT NULL,
requested_at timestamptz NOT NULL,
updated_at timestamptz NOT NULL,
next_attempt_at timestamptz NOT NULL,
terminal_at timestamptz,
last_outcome_code text,
CONSTRAINT plugin_delivery_attempt_grant_fk
FOREIGN KEY (grant_id)
REFERENCES plugin_integration.plugin_delivery_origin_grant_record (grant_id)
ON UPDATE RESTRICT
ON DELETE RESTRICT,
CONSTRAINT plugin_delivery_attempt_authority_version_check
CHECK (authority_version = 'life-os.plugin-delivery-attempt.v1'),
CONSTRAINT plugin_delivery_attempt_delivery_id_uuid_v4_check
CHECK (
delivery_id::text ~ '^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$'
),
CONSTRAINT plugin_delivery_attempt_grant_id_uuid_v4_check
CHECK (
grant_id::text ~ '^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$'
),
CONSTRAINT plugin_delivery_attempt_installation_id_uuid_v4_check
CHECK (
installation_id::text ~ '^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$'
),
CONSTRAINT plugin_delivery_attempt_workspace_id_uuid_v4_check
CHECK (
workspace_id::text ~ '^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$'
),
CONSTRAINT plugin_delivery_attempt_requested_user_id_uuid_v4_check
CHECK (
requested_by_user_id::text ~ '^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$'
),
CONSTRAINT plugin_delivery_attempt_status_check
CHECK (delivery_status = 'pending'),
CONSTRAINT plugin_delivery_attempt_count_check
CHECK (attempt_count = 0),
CONSTRAINT plugin_delivery_attempt_max_attempts_check
CHECK (max_attempts BETWEEN 1 AND 10),
CONSTRAINT plugin_delivery_attempt_time_check
CHECK (
updated_at >= requested_at
AND next_attempt_at >= requested_at
AND terminal_at IS NULL
),
CONSTRAINT plugin_delivery_attempt_outcome_check
CHECK (last_outcome_code IS NULL)
);

COMMENT ON TABLE plugin_integration.plugin_delivery_attempt_record IS
'Integration-owned durable delivery-attempt admission record; insertion requires matching active delivery-origin grant and active owning installation authority.';

CREATE FUNCTION plugin_integration.require_active_plugin_authority_for_delivery_attempt()
RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
PERFORM 1
FROM plugin_integration.plugin_delivery_origin_grant_record AS grant_record
JOIN plugin_integration.plugin_installation_record AS installation_record
ON installation_record.installation_id = grant_record.installation_id
AND installation_record.workspace_id = grant_record.workspace_id
AND installation_record.installed_by_user_id = grant_record.granted_by_user_id
WHERE grant_record.grant_id = NEW.grant_id
AND grant_record.installation_id = NEW.installation_id
AND grant_record.workspace_id = NEW.workspace_id
AND grant_record.granted_by_user_id = NEW.requested_by_user_id
AND grant_record.grant_status = 'active'
AND grant_record.revoked_at IS NULL
AND grant_record.granted_at <= NEW.requested_at
AND installation_record.installation_status = 'active'
AND installation_record.revoked_at IS NULL
AND installation_record.installed_at <= NEW.requested_at
FOR SHARE OF grant_record, installation_record;

IF NOT FOUND THEN
RAISE EXCEPTION 'plugin_delivery_attempt_active_authority_check'
USING ERRCODE = '23514',
CONSTRAINT = 'plugin_delivery_attempt_active_authority_check';
END IF;

RETURN NEW;
END;
$$;

CREATE TRIGGER plugin_delivery_attempt_active_authority_trigger
BEFORE INSERT ON plugin_integration.plugin_delivery_attempt_record
FOR EACH ROW
EXECUTE FUNCTION plugin_integration.require_active_plugin_authority_for_delivery_attempt();

CREATE INDEX plugin_delivery_attempt_pending_schedule_index
ON plugin_integration.plugin_delivery_attempt_record (
next_attempt_at,
delivery_id
)
WHERE delivery_status = 'pending';

CREATE INDEX plugin_delivery_attempt_scope_index
ON plugin_integration.plugin_delivery_attempt_record (
installation_id,
workspace_id,
requested_by_user_id,
grant_id
);
Loading
Loading