Skip to content

test(aggregator): prove historical policy input - #1914

Closed
ascorbic wants to merge 1 commit into
feat/delegated-release-servicefrom
feat/delegated-release-service-06-aggregator-history
Closed

test(aggregator): prove historical policy input#1914
ascorbic wants to merge 1 commit into
feat/delegated-release-servicefrom
feat/delegated-release-service-06-aggregator-history

Conversation

@ascorbic

@ascorbic ascorbic commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Completes delegated release service feasibility task W0.6 by proving an event-specific historical input for aggregator policy-at-publication decisions.

The prototype shows that Jetstream and delayed current-PDS reads are insufficient, while normal-size com.atproto.sync.subscribeRepos commit frames retain the signed commit, CAR/MST proof, exact record value, CID, revision, and single-relay ordering needed to recover strict -> relaxed -> release -> strict after queue delay, reordering, and redelivery.

The adapter is intentionally isolated from production ingestion. Its evidence records required W10.1 follow-ups for deletes, tooBig, DID key history, relay epochs, chain continuity, and same-commit semantics.

Related to #1908, #1870, and Discussion #1590.

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: RFC: Attested Automated Publishing #1590

i18n and a changeset are not applicable: this PR changes a private app prototype, tests, and evidence only.

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: OpenCode with GPT-5.6-sol

Screenshots / test output

  • pnpm build passes with existing virtual-import and deliberate test-plugin eval warnings
  • pnpm --filter @emdash-cms/aggregator typecheck passes
  • Focused history and existing Jetstream suites pass: 23 tests
  • pnpm lint passes with 0 warnings/errors
  • pnpm lint:json | jq '.diagnostics | length' returns 0
  • Targeted formatting and git diff --check pass

Try this PR

Open a fresh playground →

A full working EmDash site, deployed from this branch. Each visit gets its own session-scoped sandbox: no login needed and no shared state. Try the admin, edit content, hit the public site.

Tracks feat/delegated-release-service-06-aggregator-history. Updated automatically when the playground redeploys.

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 51e8cd5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added review/needs-review No maintainer or bot review yet size/XL labels Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 579 lines across 3 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-do 51e8cd5 Jul 10 2026, 01:40 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 51e8cd5 Jul 10 2026, 01:37 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground 51e8cd5 Jul 10 2026, 01:37 PM

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is a clean, well-scoped W0.6 feasibility spike: it proves that com.atproto.sync.subscribeRepos commit frames contain enough signed, event-specific material (commit CID, CAR/MST proof, record CID, rev, seq/op index) for the aggregator to recover intermediate profile values after queue delay, reordering, and redelivery. The adapter lives in apps/aggregator/src/history-spike/ and is intentionally not wired into production ingestion, matching the implementation plan’s handoff to W10.1.

I read the diff, the full new files, and traced them against existing aggregator patterns (pds-verify.ts, did-resolver.ts, the @emdash-cms/atproto-test-utils fixtures, and the delegated-release spec). The code is coherent: extraction copies the CAR per operation before enqueue, verification re-checks root CID, block CIDs, commit DID/rev, and record CID via @atcute/repo, recoverOrderedHistory deduplicates by (seq, operationIndex) and rejects conflicting redeliveries, and precedingProfileEvent correctly finds the last matching profile before a release. The tests cover the stated scenarios (strict→relaxed→release→strict, current-record inadequacy, metadata substitution, wrong signing key, delete fail-closed, conflicting redelivery) plus byte-level deduplication.

The documented limitations (delete/non-inclusion proofs, tooBig handling, DID key epochs, relay epochs, multi-relay identity, commit-chain continuity) are explicit in the evidence file, so this does not overclaim production readiness. No AGENTS.md conventions are violated: there is no admin UI, no SQL, no published-package change, and no changeset is needed for a private app prototype.

No blocking issues or needs-fixing findings.

@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/needs-review No maintainer or bot review yet labels Jul 10, 2026
@ascorbic

Copy link
Copy Markdown
Collaborator Author

Closing this feasibility spike. It is a synthetic external-research prototype rather than a test of current production code. The finding, that the current Jetstream plus current-PDS-read path cannot reconstruct intermediate policy state, remains a Gate 0/W10.1 design constraint.

@ascorbic ascorbic closed this Jul 10, 2026
@ascorbic
ascorbic deleted the feat/delegated-release-service-06-aggregator-history branch July 10, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: signed review/approved Approved; no new commits since size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant