Skip to content

feat(autosync): preflight keyed prompt authority before push - #1540

Merged
dnlrsls merged 1 commit into
Gentleman-Programming:feat/prompt-inbox-foundation-trackerfrom
dnlrsls:feat/eligible-prompt-autosync-preflight
Sep 29, 2026
Merged

dnlrsls merged 1 commit into
Gentleman-Programming:feat/prompt-inbox-foundation-trackerfrom
dnlrsls:feat/eligible-prompt-autosync-preflight

Conversation

@dnlrsls

@dnlrsls dnlrsls commented Sep 29, 2026

Copy link
Copy Markdown
Member

🔗 Linked Issue

Closes #1458

Child of open tracker #1464, based on its latest head e7f5c14d. Target feat/prompt-inbox-foundation-tracker only; do not merge directly to main or queue tracker yet.

🏷️ PR Type

  • type:bug — Bug fix
  • type:feature — New feature
  • type:question — Question requiring tracked work
  • type:docs — Documentation only
  • type:refactor — Code refactoring
  • type:chore — Maintenance
  • type:breaking-change — Breaking change

📝 Summary

  • Preflight a keyed prompt mutation using exact independently stored local prompt and live session provenance; register the session owner then claim the source pair with owner and prompt projects before any push.
  • Failed registration/claim or missing evidence leaves that entry pending, without push or ack; healthy later outbound pages progress within a fixed eligible target-scoped journal high-water.
  • Document boundaries: imported/old sources are not implicitly authorized, and cloud deletes are not enabled here.

📂 Changes

File Change
internal/cloud/autosync/manager.go Fail-closed keyed prompt preflight and bounded outbound pages.
internal/cloud/autosync/manager_test.go Regressions for exact provenance, failures, later-page progress and stale sync-state counter.
cmd/engram/autosync_e2e_test.go Fake journal paging compatibility in CLI tests.
docs/codebase/prompt-inbox-provenance.md Current provenance requirements and explicit older-source boundary.

345 additions + 41 deletions = 386 changed lines. No duplicate store helper; it arrived through PR #1539.

🧪 Test Plan

  • Focused autosync cases for preflight/no implicit authority/stale state/blocked first page — PASS.
  • go test ./internal/cloud/autosync ./cmd/engram ./internal/store -count=1 — writer and independent verifier PASS.
  • go vet on these packages; gofmt listing and git diff --check — PASS.
  • Native single-lens review review-a9bd33e5ba6528a1 approved and acknowledged; two non-blocking advisories to inspect in follow-up.
  • GitHub unit/E2E/plugin/lint/Windows/policy checks — pending at PR creation.

🤖 Automated Checks

Pending until CI runs; do not infer from local evidence. Performance ratchet and CodeRabbit may skip on this non-default base.

✅ Contributor Checklist

💬 Notes for Reviewers

Important follow-up before tracker/main validation: independent verification found that the existing cycle() skips pull for any push failure. With this new fail-closed preflight, a permanently unverified keyed prompt can now keep inbound pull stalled on retries, even though later outbound entries progress. Tracked as T4b3a2c, a separate ≤400-line child to distinguish per-entry authorization failures from transport failures, permit safe pull, preserve failed outbound status and pending/no ack, and update the legacy skip-pull regression. This slice is not a claim that inbound starvation is solved. Do not queue #1464 until T4b3a2c, explicit per-source CLI reauthorization (T4b3b), cloud delete admission (T4c) and integrated validation (T5) are complete.

@dnlrsls dnlrsls added the type:feature New feature label Sep 29, 2026
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 8354ec4b-a926-4d19-8be9-d171018d134d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dnlrsls
dnlrsls merged commit 9411cfc into Gentleman-Programming:feat/prompt-inbox-foundation-tracker Sep 29, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant