feat(fof-layer4): supersedes_post_id field on Post
Adds an optional supersedes_post_id pointer to Post for the "re-issue with narrower access" path. Author publishes a new post that references an earlier one; receivers can render "this is a re-issued version of an earlier post" + offer to view the original. Covered by PostId = BLAKE3(Post) — receivers can verify it wasn't forged by anyone but the author. #[serde(default)] for back-compat; existing posts deserialize with None. All existing Post construction sites bulk-updated to set the field to None. Storage::get_post returns None for the field today; a follow-up can add a dedicated column if/when receivers need to render the pointer. The author-side re-issue helper that creates posts with this field set comes in the Tauri/UI slice — the wire shape is in place now. 148 tests pass (no regressions). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c2f2203331
commit
fdbf97f2d7
11 changed files with 50 additions and 0 deletions
|
|
@ -914,6 +914,7 @@ mod tests {
|
|||
attachments: vec![],
|
||||
timestamp_ms: 3000,
|
||||
fof_gating: Some(built.gating.clone()),
|
||||
supersedes_post_id: None,
|
||||
};
|
||||
|
||||
// Bob's device unlocks the post via his V_me (= v_x_bob).
|
||||
|
|
@ -995,6 +996,7 @@ mod tests {
|
|||
let post = crate::types::Post {
|
||||
author: alice_id, content: "alice".into(), attachments: vec![],
|
||||
timestamp_ms: 3000, fof_gating: Some(built.gating.clone()),
|
||||
supersedes_post_id: None,
|
||||
};
|
||||
s.store_post_with_intent(
|
||||
&post_id, &post,
|
||||
|
|
@ -1085,6 +1087,7 @@ mod tests {
|
|||
let post = crate::types::Post {
|
||||
author: alice_id, content: "alice".into(), attachments: vec![],
|
||||
timestamp_ms: 3000, fof_gating: Some(built.gating.clone()),
|
||||
supersedes_post_id: None,
|
||||
};
|
||||
s.store_post_with_intent(
|
||||
&post_id, &post,
|
||||
|
|
@ -1186,6 +1189,7 @@ mod tests {
|
|||
let post = crate::types::Post {
|
||||
author: alice_id, content: "x".into(), attachments: vec![],
|
||||
timestamp_ms: 3000, fof_gating: Some(built.gating.clone()),
|
||||
supersedes_post_id: None,
|
||||
};
|
||||
s.store_post_with_intent(
|
||||
&post_id, &post,
|
||||
|
|
@ -1334,6 +1338,7 @@ mod tests {
|
|||
let alice_post = crate::types::Post {
|
||||
author: alice_id, content: String::new(), attachments: vec![],
|
||||
timestamp_ms: 3000, fof_gating: Some(built.gating.clone()),
|
||||
supersedes_post_id: None,
|
||||
};
|
||||
let bob_unlock = find_unlock_for_post(&bob_storage, &alice_post).unwrap()
|
||||
.expect("Bob can unlock");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue