Skip to content

Commit 47e5f36

Browse files
Merge pull request block#2292 from launchpad-26/fix/rqa-policy-snapshot-repo
docs(rqa): align snapshot repository contract (block#2233)
2 parents 87704ed + 9a1476f commit 47e5f36

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

‎launchpad/skills/review-queue-automation/architecture/code/P-03-policy.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ correctly.
300300
```sql
301301
CREATE TABLE snapshots (
302302
hash TEXT PRIMARY KEY, -- sha256 hex digest over the entire canonical config
303-
repo TEXT NOT NULL, -- the repo of first activation; informational, not a key
303+
repo TEXT NOT NULL, -- reserved compatibility field; activate() has no repo
304+
-- argument and writes the intentional empty sentinel ""
304305
policy_version TEXT NOT NULL,
305306
protocol_hash TEXT NOT NULL,
306307
activated_at TEXT NOT NULL, -- ISO-8601 UTC, first time this hash was ever seen
@@ -312,8 +313,9 @@ CREATE TABLE snapshots (
312313
# store.py
313314
@dataclass(frozen=True)
314315
class StoredSnapshot:
315-
snapshot: Snapshot # repo is a placeholder ("") here; snapshot_for() rebuilds it with
316-
# the caller's own repo before returning
316+
snapshot: Snapshot # repo is the intentional empty sentinel ("") here;
317+
# snapshot_for() rebuilds it with the caller's own repo
318+
# before returning
317319
activated_at: datetime
318320

319321
class SnapshotStore(Protocol):

‎launchpad/skills/review-queue-automation/rqa/policy/store.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@
6262

6363
@dataclass(frozen=True)
6464
class StoredSnapshot:
65-
snapshot: Snapshot # repo is a placeholder ("") here; snapshot_for() rebuilds it with
66-
# the caller's own repo before returning
65+
snapshot: Snapshot # repo is the intentional empty sentinel ("") here;
66+
# snapshot_for() rebuilds it with the caller's own repo
67+
# before returning
6768
activated_at: datetime
6869

6970

@@ -81,8 +82,8 @@ class SqliteSnapshotStore:
8182
alone.
8283
8384
The `snapshots.repo` column is written as `""`. §5 fixes `activate(hash, raw, at)`
84-
with no repository argument and documents the column as "informational, not a
85-
key", so the store genuinely never learns a repo; `snapshot_for` puts the
85+
with no repository argument and documents the column as a "reserved compatibility
86+
field", so the store genuinely never learns a repo; `snapshot_for` puts the
8687
caller's own `repo` on the `Snapshot` it returns. Nothing reads the column.
8788
"""
8889

0 commit comments

Comments
 (0)