carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package fixture
2
3// Not compiled. The ways round the provenance rule that the 2026-10-11
4// re-review of Plan 6 Task 1a found, plus a forged serverText. Each one
5// must fail the gate (TestMovesProvenanceBypassesFail).
6
7type serverText struct{ spoken string }
8
9type moveJournal struct{ StuckReason string }
10
11func moveSay(out int, line string) {}
12
13func sayError(out int, err error) { moveSay(out, err.Error()) }
14
15// Bypass 3: the forwarding sink reassigns its own parameter.
16func sayRecorded(out int, text string) {
17 text = "unreviewed reassignment"
18 moveSay(out, text)
19}
20
21func saySpoken(out int, t serverText) {}
22
23func apiErrorFromBody(status int, body []byte) error {
24 var e struct{ Error string }
25 if json.Unmarshal(body, &e) == nil && e.Error != "" {
26 return errors.New(e.Error)
27 }
28 return fmt.Errorf("unexpected response (status %d)", status)
29}
30
31// Bypass 1: the console's error decoder, fed literal JSON.
32func literalJSON(out int) {
33 sayError(out, apiErrorFromBody(400, []byte(`{"error":"unreviewed copy"}`)))
34}
35
36// Bypass 2: a stuck reason written here, not read from an answer.
37func forgedStuck(out int) {
38 j := moveJournal{StuckReason: "unreviewed stuck reason"}
39 sayRecorded(out, j.StuckReason)
40}
41
42// Server text made outside its one maker.
43func forgedServer(out int) {
44 saySpoken(out, serverText{spoken: "unreviewed server text"})
45}
46
47// Server text read outside its one sink.
48func leaked(out int, t serverText) {
49 moveSay(out, "the console says "+t.spoken)
50}
51