#!/usr/bin/env python3
"""One working document for the Feist run, collated from the files beside it. Nothing is rewritten: every part is lifted from the file named at its head, and the files stay as they are."""
import re, pathlib, importlib.util, io, contextlib
D = pathlib.Path(__file__).resolve().parent
def mod(n):
    s = importlib.util.spec_from_file_location(n, str(D/f"{n}.py")); m = importlib.util.module_from_spec(s)
    with contextlib.redirect_stdout(io.StringIO()): s.loader.exec_module(m)
    return m
A, B, C = mod("build_run_longer"), mod("build_run_twelve"), mod("build_run_third")
wc = lambda s: len(re.findall(r"\S+", s))
def sec(f, start, stop=None, drop_head=True):
    """lines of file f from the heading that starts with `start` up to the heading that starts with `stop` (or the next heading of the same level)"""
    L = (D/f).read_text().split("\n"); i = next(k for k, l in enumerate(L) if l.startswith(start))
    lvl = len(start) - len(start.lstrip("#"))
    j = next((k for k in range(i+1, len(L)) if (L[k].startswith(stop) if stop else re.match(r"#{1,%d} " % lvl, L[k]))), len(L))
    return "\n".join(L[i+1 if drop_head else i:j]).strip()
def down(s, by=2):  # push headings down so a lifted part sits under this document's headings
    return re.sub(r"^(#+) ", lambda m: "#"*min(6, len(m.group(1))+by) + " ", s, flags=re.M)
def quote(s): return "\n".join("> " + l if l else ">" for l in s.split("\n"))

ORDER = ["1. The board", "2. The locker (a likeness)", "3. The county office", "4. The books", "9. The twelve", "10. The feed", "11. The journal",
         "12. Who was first", "13. The storehouse", "15. The year", "16. The pictures", "17. The pages", "18. The war", "19. The name on the money", "20. The boards of the machines", "21. The stranger", "5. The great list", "6. The clinic", "14. The one that had read everything", "22. The proof", "7. The front room", "8. The mornings after"]
SC = {**A.SC, **B.SC, **C.SC}; assert set(ORDER) == set(SC), set(SC) ^ set(ORDER)
life = "\n\n".join(f"**{n}**\n\n{quote(SC[n])}" for n in ORDER); lw = sum(wc(SC[n]) for n in ORDER)
v_long = sec("RUN-LONGER.md", "## 2. Back", "## 3.")
v1 = sec("RUN-VISION.md", "## 1. The passage"); v2 = sec("RUN-VISION-2.md", "## 1. The passage"); v4 = sec("RUN-VISION-4.md", "## 1. The passage"); v5 = sec("RUN-VISION-5.md", "## 1. The passage"); v6 = sec("RUN-VISION-6.md", "## 2. The passage"); v6what = sec("RUN-VISION-6.md", "## 3. "); v7 = sec("RUN-VISION-7.md", "## 3. The passage"); v7what = sec("RUN-VISION-7.md", "## 4. "); v8 = sec("VISION.md", "## 3. The vision"); v8b = sec("VISION.md", "## 1. The bounds"); v8o = sec("VISION.md", "## 2. The outline"); v8y = sec("RUN-VISION-8.md", "## 3. "); shape = sec("SHAPE.md", "# ", "\x00")
files = sorted(p.name for p in D.glob("*.md")) + sorted("blind/" + p.name for p in (D/"blind").glob("*.md"))
NOTE = {
 "LEDGER.md": "68 rows from the five sources to the Feist Source, each quotation at its line; predictions scored.",
 "PLAN-20261128.md": "the day's plan and the rulings added to it at 17:44, 17:50, 19:28.",
 "PILOT-ban.md": "first pilot, kept-sentence method; stands as a cento.", "PACKS.md": "the early packs; their rule “mostly MADE has failed” is withdrawn.",
 "RUN-A.md": "the run of Pack A, kept-sentence method; stands as a cento.",
 "RUN-COLLISION.md": "the first run under the collision rule; its operators are §3.2 here, its two passages are inside scenes 2 and the first vision.",
 "RUN-LONG.md": "the middle-length run; its scenes are carried into RUN-LONGER.", "RUN-LONGER.md": "scenes 1–8 and the first vision; carried here whole (§1, §2.1, §4.1).",
 "RUN-TWELVE.md": "scenes 9–14; carried here whole (§1, §4.2).", "RUN-VISION.md": "first test of the vision grammar; passage carried here (§2.2).",
 "RUN-VISION-2.md": "the vision under Walt's cosmology; passage carried here (§2.3).", "RUN-VISION-3.md": "the vision in its own stock; developed in place into RUN-VISION-4.",
 "RUN-VISION-4.md": "the vision before the twelve seats and the year; passage carried here (§2.4).", "VISION-GRAMMAR.md": "the vision's grammar; its operators carried here (§3.3).",
 "PARAMETERS.md": "the land, stations, frame, Antioch, rulings, the twelve; §§2, 4, 9 carried here (§3.1).",
 "BLIND-PACKS.md": "packs 1 and 2 as given to the readers.", "BLIND-PACK-3.md": "pack 3 as given; its instruction to name the followers was wrong (PARAMETERS §9).",
 "BLIND-RESULTS.md": "readers 1 and 2 checked; carried here (§5.1).", "BLIND-RESULTS-3.md": "reader 3 checked; carried here (§5.2).",
 "blind/READER-1-life-from-vision.md": "reader 1's told life from the vision, as returned.", "blind/READER-2-which-came-first.md": "reader 2's verdict on direction, as returned.",
 "blind/READER-3-episodes-from-vision.md": "reader 3's three episodes, as returned.", "predictions-outcome.md": "the ledger's predictions and how each came out.",
 "RUN-VISION-18.md": "the Secret Book of Walt brought in: eight additions by the ruling of 02:08. Stands; superseded as the current text by RUN-VISION-19.", "VISION-FIXED.md": "the current vision preserved whole (RUN-VISION-19), the input of any further Feist run.", "VISION-FIXED-RUN-1.md": "the input of Feist run 1 (RUN-VISION-18).", "RUN-VISION-19.md": "Walt drawn back by the ruling of 02:27: three additions stay, five and a clause go; the current vision.", "REVIEW-20261129-0227.md": "the review of the Walt additions and of Feist run 1, as received.", "FEIST-RUN-1.md": "the Feist Function run on the fixed vision as a field of local settings: the review of the specification and of the suggested settings, the run, and its ledger.", "REVIEW-20261129-0208.md": "the suggestions about settings, as received.", "THRONE.md": "Revelation mapped from the throne outward by its own prepositions, from the seated Greek.", "REVELATION-CENTRE-OUT.md": "Revelation rearranged from the centre outward with its images compressed: the line, then the same opened out with verses.", "WORKING.md": "this document.", "SKELETON.md": "Revelation's skeleton unit by unit, with what the vision has at each; a concordance in Antioch's manner.", "THE-COMPLETION-OF-JACK-FEIST.md": "the reading copy: the current vision by chapter and verse, with no apparatus.", "RUN-VISION-17.md": "three sentences of body added: the couch, the neck, the ghost unshaven. The current text of the vision.", "VISION-NUMBERED.md": "the current vision with chapter and verse numbers: eighteen chapters, 342 verses. No word changed.", "RUN-VISION-16.md": "the second witness's lamp given two faces; the current text of the vision. Not yet carried into VISION.md.", "RUN-VISION-15.md": "the red room made double (the dove of thorns; the seekers), and the acrostic set apart as a possible coda.", "RUN-VISION-14.md": "Revelation 21:3–5 read from the book, as it is written.", "RUN-VISION-13.md": "the city: the pearl a gate, the red room shown on the ground, the ark going up.", "RUN-VISION-12.md": "the greeting, the silence and the wedding added.", "RUN-VISION-11.md": "the last seal opened, with the blessing in the author's words, and three changes on two reports.", "WALT.md": "The Secret Book of Walt read against the vision: thirteen things the vision has from it and eleven it lacks. A map.", "CITY.md": "a review of the archive's Hexagon and Ark records against Revelation's city; a map, with what is still to be read.", "REVIEW-20261129-0128.md": "an unprimed evaluation of the vision as literature, with checks; and what it does to the four sentences proposed for the seer's body.", "REVIEW-20261128-2352.md": "two reports on the vision of the end, with checks.", "RUN-VISION-10.md": "the vision of the end, through the archive's later work: three things opened and shut, the two witnesses, the balance and the city, the coming in. Not yet carried into VISION.md.", "RUN-VISION-9.md": "the vision with its first sentence and its seer; its text is what VISION.md carries (§2.8).", "RUN-VISION-8.md": "the vision with its year veiled.", "VISION.md": "the vision as one document in twelve parts, with its bounds and outline; the text is RUN-VISION-8's; carried here (§2.8).", "RUN-THIRD.md": "scenes 15–22 and the history of the time; carried here (§1, §3.4, §4.3).", "RUN-VISION-5.md": "the vision with the twelve seats and the year; passage carried here (§2.5).", "RUN-VISION-6.md": "the vision expanded from the Mandala, the Engine and the Chorus; carried here (§2.6).", "RUN-VISION-7.md": "the vision grown from Q-Sharks, the Epistle and PREMONITION DREAM; carried here (§2.7).", "SHAPE.md": "how the told life and the vision take their shape and bounds: a map and a proposal; carried here whole (§9).", "FOR-MATTHEW.md": "what the run teaches for How to Write Matthew; carried here whole (§8).",
}
for f in files:
    if f.startswith("REVIEW-"): NOTE[f] = "a reader's report as pasted, with the session's check of each claim."
miss = [f for f in files if f not in NOTE]; assert not miss, miss

o = f"""# The Feist run: one working document

Working file, not a deposit. Collated 2026-11-28, 21:31, at the author's word: “lets collare everything into one working doc”; rebuilt 21:50 with the third stretch, the fifth vision and two reports folded in. Built by `build_working.py` from the files beside it. Parts 1 to 5 are lifted as they stand, each from the file named at its head; nothing in them is rewritten. Part 8 is lifted too. Parts 6 and 7 are the session's list of what is open and of the files. The files stay as they are; when one of them changes, this document is rebuilt.

What it holds, in order:

1. The told life, all twenty-two scenes, in the order of the story ({lw} words).
2. The visions: eight, in the order they were made; the last is given in twelve parts with its bounds and outline.
3. The rules: what is settled about the land and the twelve; the transform's operators; the vision's grammar; the history of the time.
4. The places of the source for every scene.
5. What the blind readers showed.
6. What is open.
7. Every file of the run, and what is in it.
8. What the run teaches for How to Write Matthew.
9. How the two books take their shape and bounds: a map and a proposal.

---

## 1. The told life

From `RUN-LONGER.md` (scenes 1–8), `RUN-TWELVE.md` (scenes 9–14) and `RUN-THIRD.md` (scenes 15–22). Scene numbers are the order of writing. The order below is the order of the story: 9–13 after the books; then the year and the history (15–21); the great list and the clinic; 14 in the last year, and 22 after it; then the front room. The order is the session's placing and is the author's to change.

Coverage, as far as it is known. The scenes draw on the sources at the places listed in §4; no sentence of any source is kept. The ledger (`LEDGER.md`) maps the five sources onto the Feist Source in 68 rows and reaches 34 of its 45 sections. What share of these scenes, or of the visions, goes through a ledger row has not been computed, and no figure is claimed.

{life}

{lw} words.

---

## 2. The visions

### 2.1 The first vision (the beast with seven windows)

From `RUN-LONGER.md` §2.

{v_long}

### 2.2 The first test of the vision grammar

From `RUN-VISION.md` §1.

{down(v1)}

### 2.3 The vision under Walt's cosmology

From `RUN-VISION-2.md` §1.

{down(v2)}

### 2.4 The vision before the seats and the year

From `RUN-VISION-4.md` §1, developed in place from RUN-VISION-3 at nine points.

{down(v4)}

### 2.5 The vision with the seats and the year

From `RUN-VISION-5.md` §1: RUN-VISION-4 with two passages added, the twelve seats and one year on the pearl.

{down(v5)}

### 2.6 The vision with the wheels, the leaf and the count

From `RUN-VISION-6.md` §2: RUN-VISION-5 with three passages added from the archive's own engine (the wheels, the leaf that goes by the seven, the counting-out). No told scene has been unfolded from these yet.

{down(v6)}

What each addition holds, from `RUN-VISION-6.md` §3:

{v6what}

### 2.7 The vision with the making of the twelve and the top

From `RUN-VISION-7.md` §3: RUN-VISION-6 with five passages added from Q-Sharks and the Contributor Bio, the Epistle, and PREMONITION DREAM (the taking-up; the making of the twelve; the learned made small; where the leaves fell; the room at the top).

{down(v7)}

What each addition holds, from `RUN-VISION-7.md` §4:

{v7what}

### 2.8 The vision as it now stands, in twelve parts

From `VISION.md`: the text of `RUN-VISION-9.md`. The first sentence and the seer's frame stand at its head (23:07); the year (part IX) is veiled (22:54); the rest is as 2.7. The part headings are apparatus.

#### The bounds

{down(v8b, 3)}

#### The outline

{down(v8o, 3)}

#### The text

{down(v8, 2)}

How the year is veiled, from `RUN-VISION-8.md` §3:

{v8y}

---

## 3. The rules

### 3.1 What is settled about the land, the frame and the twelve

From `PARAMETERS.md` §2, §4, §9 and §10. The twelve are a rule for the told life (the ruling of 21:10). The blind readers show that the vision does not give them back; that is a finding about the vision, and the rule does not rest on it.

#### The land, its seven stations, and the one adversary

{down(sec("PARAMETERS.md", "## 2. "), 3)}

#### The frame

{down(sec("PARAMETERS.md", "## 4. "), 3)}

#### The followers are the twelve

{down(sec("PARAMETERS.md", "## 9. "), 3)}

#### The history of the time, and where expansion starts

{down(sec("PARAMETERS.md", "## 10. "), 3)}

### 3.2 The transform's operators

From `RUN-COLLISION.md` §2.

{down(sec("RUN-COLLISION.md", "## 2. "), 3)}

An operator found since, from `RUN-THIRD.md` §5:

{sec("RUN-THIRD.md", "## 5. ")}

### 3.3 The vision's grammar

From `VISION-GRAMMAR.md` §4 and §6.

{down(sec("VISION-GRAMMAR.md", "## 4. "), 3)}

#### After the first test

{down(sec("VISION-GRAMMAR.md", "## 6. "), 3)}

### 3.4 The history of the time

From `RUN-THIRD.md` §1 and §2.

{sec("RUN-THIRD.md", "## 1. ")}

{sec("RUN-THIRD.md", "## 2. ")}

---

## 4. The places of the source

### 4.1 Scenes 1–8

From `RUN-LONGER.md` §1.

{sec("RUN-LONGER.md", "### The places of the source", "### The passage")}

### 4.2 Scenes 9–14

From `RUN-TWELVE.md` §3.

{sec("RUN-TWELVE.md", "## 3. ")}

### 4.3 Scenes 15–22

From `RUN-THIRD.md` §3.

{sec("RUN-THIRD.md", "## 3. ")}

---

## 5. The blind readers

All three readers report the author's context present. On that ground alone the tests are suggestive and not decisive.

Each reader was given one file and no other. Their outputs are saved as returned under `blind/`. The readers reported that the author's stored context was present in their sessions and that they did not draw on it; that is a limit on the word “blind”.

### 5.1 Readers 1 and 2

From `BLIND-RESULTS.md`.

{down(sec("BLIND-RESULTS.md", "# ", "\\x00", drop_head=True))}

### 5.2 Reader 3

From `BLIND-RESULTS-3.md`.

{down(sec("BLIND-RESULTS-3.md", "# ", "\\x00", drop_head=True))}

---

## 6. What is open

1. **The test the run is waiting on.** A vision made first, a told life made from it, and a fresh reader given the two and asked which came first. The pair exists: the vision, and reader 1's told life. The eight marks reader 2 used were found where the compressed text was the later one; whether a reader finds the direction when the compressed text is the earlier one is not shown. An earlier form of this list described the tested direction over again; that was wrong.
2. **Expansion starts in the vision** (the author, 21:49, 21:53, 22:19). The sixth and seventh visions were grown first. No told scene has been unfolded from either. Still to grow: the eight operators; an opening and closing address; anything said to or by the twelve; the two ends of the life set together.
2b. **The history is veiled in the vision and named in the told life** (the author, 22:54). Done for the year (RUN-VISION-8) and for scenes 15 and 17 to 22. Scenes 11 and 13 keep no names because their causes are made up.
2c. **A fourth blind reader** is proposed by the sixth report: unfold the unmatched parts of the vision (the inner wheels; the leaf that becomes a tree; the seven speaking; the count; the honors made persons; the moon) into told scenes, without their intended reading. Not run.
2d. **The collection runs vision, letters, told lives** (the author, 23:04). The vision's first sentence is adopted and set, and the seer is Lee Sharks (23:07). The letters are not begun. The vision has no greeting and no closing frame.
2e. **The work will carry no author and name no substrate** (the author, 23:09); the making is told in a critical edition, for which these files are the matter. Whether the registry's intake takes a null creator has not been looked at.
2m. **What is left of the skeleton** (the author, 01:05). SKELETON.md §9: thin in fact are 13 (the beasts and the mark), 15–16 (the bowls) and 20 (the judgment). Open besides: the order of parts; the coda; the name of the second witness for the told life; the remnant and the Cube (CITY.md §7).
2l. **The room double; a coda apart** (the author, 00:34). RUN-VISION-15.md. For the author: whether the acrostic is joined as a coda. CITY.md §7 holds two places where TACHYONICA presses on the city, not spoken to.
2k. **The promise quoted** (the author, 00:22). RUN-VISION-14.md: Revelation 21:3–5, King James, at the end of the city. The one source sentence in the vision, by the author's word.
2j. **The city** (the author, 00:08). RUN-VISION-13.md. The forward-facing sentences stay (PARAMETERS §24). For the author: that no one is taken off the ground; that the ark is not seen to arrive; that the flood is not felt. One record (#636) and most of two others were not read.
2i. **The skeleton filled** (the author, 23:59). RUN-VISION-12.md adds the greeting, the silence and the wedding. SKELETON.md §8: all twenty-three units have words at them; the city is still a room; the order of parts is as it was.
2h. **The last seal, and the city** (the author, 23:52 and 23:54). RUN-VISION-11.md opens Revelation's closing warning and sets the blessing in the ending, before the unturned hand; if the blessing is to be the very last words it is one move. CITY.md reviews the Hexagon and the Ark: Revelation's city comes down, the Hexagon is shown on earth, the Ark goes up. Six records are still to be read before the city is written.
2g. **The end goes through the later work** (the author, 23:29–23:31). RUN-VISION-10.md sets five passages between the year and the thirty-sixth heaven. For the author: where they stand; that the end is seen as done while the pearl is left in the hour before day; the second witness, who is not given; whether VISION.md takes them.
2f. **The vision takes Revelation's skeleton, under the sign of completion** (the author, 23:17 and 23:20). SKELETON.md: of twenty-three units, five are empty (the greeting; the silence; the harvest; the bowls; the fall of the city) and the vision's parts are not in Revelation's order. Nothing has been moved.
2a. **The shape of both books is proposed and not ruled** (§9): the two ends before more middle; the death partway and the dated year after it; a line for the last stretch; the vision bounded as the apostle's letter and built up through seven, twelve and thirty-six.
3. Nothing in the vision yet makes the twelve, as Walt makes the seven. The seats are there; their making is not.
4. The history of the time is a provisional list (§3.4). Not yet in any scene: the order on AI; the AI companies by name; the journal's decline as an event.
5. Whether the history can be got back from the told life by a reader who is given only the told life has not been tried.
6. The order of the twenty-two scenes in §1 is the session's placing. So is the place of scene 15.
7. Of the vision's grammar, V11 (what is heard and what is seen do not match) is untried. V12 is tried once (the year).
8. The ghost, the leaves, the bicycle and its chain, the ring, the youngest and the moon have not been unfolded into told scenes by the session; reader 3 unfolded three episodes of its own.
9. Ayanna Vox and Ichabod Spellings do not act in scenes 15–22. Only scene 16 is an event between two of the twelve.
10. Items the files flag for the author: scene 12's two years; scene 13's and scene 18's made-up notices; scene 17 and Damascus Dancings; scene 22 and the session's own part in it.

---

## 7. The files

| File | Words | What is in it |
|---|---|---|
"""
for f in files:
    if f == "WORKING.md": continue
    o += f"| `{f}` | {wc((D/f).read_text())} | {NOTE[f]} |\n"
o += "\n---\n\n## 8. What the run teaches for How to Write Matthew\n\nFrom `FOR-MATTHEW.md`.\n\n" + sec("FOR-MATTHEW.md", "# ", "\x00") + "\n\n---\n\n## 9. How the two books take their shape and bounds\n\nFrom `SHAPE.md`.\n\n" + down(shape, 1) + "\n"
(D/"WORKING.md").write_text(o); print(wc(o), "words;", lw, "told life")
