|
| 1 | +# Define Mission Request Ingress Replay And Acknowledgement - Software Design Description |
| 2 | + |
| 3 | +> Define Keeper replayable ingress and acknowledgement behavior for formal mission requests |
| 4 | +
|
| 5 | +**SRS:** [SRS.md](SRS.md) |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +This voyage defines Keeper’s first provider-ingress lifecycle for formal mission |
| 10 | +requests. The design makes GitHub issue activation the first provider path while |
| 11 | +keeping the normalized ingress model replayable and cleanly separated from the |
| 12 | +native Keel command surface. |
| 13 | + |
| 14 | +## Context & Boundaries |
| 15 | + |
| 16 | +### In Scope |
| 17 | + |
| 18 | +- GitHub issue activation detection |
| 19 | +- normalized ingress record and revision behavior |
| 20 | +- retry and acknowledgement ownership boundaries |
| 21 | + |
| 22 | +### Out of Scope |
| 23 | + |
| 24 | +- non-GitHub providers |
| 25 | +- cryptographic transport hardening |
| 26 | +- direct mutation of planning state by provider adapters |
| 27 | + |
| 28 | +### External Actors |
| 29 | + |
| 30 | +- GitHub issues as provider artifacts |
| 31 | +- Keeper ingress worker |
| 32 | +- native `keel mission request` commands |
| 33 | + |
| 34 | +## Dependencies |
| 35 | + |
| 36 | +| Dependency | Type | Purpose | Version/API | |
| 37 | +|------------|------|---------|-------------| |
| 38 | +| GitHub issue activation format | External contract | First provider activation signal | Title/body schema | |
| 39 | +| Canonical mission request commands | Internal contract | Native Keel mutation and validation surface | CLI contract | |
| 40 | +| Keeper ingress runtime | Internal service | Polling, normalization, retry, and acknowledgement orchestration | Keeper architecture | |
| 41 | + |
| 42 | +## Key Decisions |
| 43 | + |
| 44 | +| Decision | Choice | Rationale | |
| 45 | +|----------|--------|-----------| |
| 46 | +| Versioned ingress records | Represent provider edits and retries as canonical revisions | Keeps replay and deduplication explicit | |
| 47 | +| Provider-owned acknowledgements | Keeper owns transport-facing comments/status updates | Preserves the Keel/Keeper split | |
| 48 | +| GitHub-first, not GitHub-only | Use GitHub issue activation as the first adapter on top of a generic ingress model | Avoids locking the model to one provider | |
| 49 | + |
| 50 | +## Architecture |
| 51 | + |
| 52 | +The ingress design has three layers: |
| 53 | +- provider detection: recognize formal GitHub mission request activations |
| 54 | +- normalization and revisioning: convert provider payloads into canonical request revisions |
| 55 | +- acknowledgement orchestration: decide when Keeper emits provider-facing acknowledgements versus calling native Keel commands |
| 56 | + |
| 57 | +## Components |
| 58 | + |
| 59 | +- Activation detector: matches the formal title prefix and required body sections. |
| 60 | +- Revision normalizer: produces canonical request revisions and deduplicates retries. |
| 61 | +- Keel command bridge: calls native mission-request commands for validation, draft, and apply behavior. |
| 62 | +- Acknowledgement renderer: prepares provider-facing acknowledgement content from canonical outcomes. |
| 63 | + |
| 64 | +## Interfaces |
| 65 | + |
| 66 | +- Provider input: GitHub issue title, body, metadata, and edit history. |
| 67 | +- Normalized ingress record: canonical request plus revision metadata and replay identity. |
| 68 | +- Command bridge output: success, validation failure, or execution failure from native Keel commands. |
| 69 | +- Provider acknowledgement output: comment/status payloads owned by Keeper. |
| 70 | + |
| 71 | +## Data Flow |
| 72 | + |
| 73 | +1. Keeper reads a GitHub issue candidate. |
| 74 | +2. Activation detection validates the formal mission request prefix and body shape. |
| 75 | +3. The normalizer emits a canonical request revision and deduplicates retries. |
| 76 | +4. Keeper invokes native mission-request commands with the canonical payload. |
| 77 | +5. Keeper renders a provider-facing acknowledgement from the canonical result. |
| 78 | + |
| 79 | +## Error Handling |
| 80 | + |
| 81 | +| Error Condition | Detection | Response | Recovery | |
| 82 | +|-----------------|-----------|----------|----------| |
| 83 | +| Issue title/body do not satisfy activation format | Activation detector | Ignore or mark as invalid request candidate | Provider edits request into valid form | |
| 84 | +| Provider edit changes a previously ingested request | Revision normalizer | Emit a new canonical revision | Keeper re-runs validation/draft/apply as configured | |
| 85 | +| Duplicate delivery or retry arrives | Replay identity check | Reuse the existing canonical revision outcome | No duplicate planning mutation | |
| 86 | +| Provider acknowledgement fails after Keel processing | Transport response failure | Preserve canonical command outcome and surface retryable provider error | Keeper retries acknowledgement without replaying planning mutation | |
0 commit comments