Skip to content
C.W.K.
Stream
Lesson 05 of 05 · published

The Second Extraction

~12 min · extraction, census, shared-kit, drift-guard, standing-practice

Level 0Cold Vessel
0 XP0/37 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

The Second Extraction

The first extraction proves the rule; the second proves the system. Once two workshops had earned the neutral queue kernel, a harder question was still open: what about the code that binds one workshop to that kernel — the engine body, the CLI verbs, the attachment store? Those files teach the generic mechanics to be one product, and they looked product-shaped enough to escape the first pass.

The answer came as a census, not an edit. Before moving anything, the program counted. The attachment store matched byte for byte between the two workshops. The engine and command line matched too, once each app's own name was substituted away — except for three drifts nobody could justify: which layer mints the slug, which side guards the one-open race, and which repository a landing converges. The extraction took the seam and reconciled those drifts on the way; identical text was the clue, the reconciled differences were the craft. One web-serving policy was found hand-written across twenty-six engines in three different shapes — a census is also how you discover the second-use window closed long ago. A shared browser-origin rule existed as ten identical copies plus one that had quietly flipped the order of two checks. “This probably repeats” became a measured claim: this many copies, this many shapes, this one drifted.

The vehicle was the workshop's own ladder. A named pipeline — created through exactly the explicit path the promotion track teaches — took extraction as its domain: move one plumbing shape into the shared kit, then converge every copy. Seven promotions ran through it in a single afternoon, each queued, gated, and landed as an ordinary row in the same record system. The doctrine did not merely survive contact with its own workshop; it produced the tooling for its own repetition.

Notice where the boundary lives after the extraction. Each consumer vendors a generated copy stamped do-not-edit-here, and a drift test fails the suite on a hand edit. Fixes happen once, upstream, and propagate by resync. The rule is enforced by the harness because a warning comment loses to a deadline and a failing test does not. Boundaries by structure outlast boundaries by prose.

A Standing Practice, Not a Project

Weeks later, the umbrella task tracking kit-ification was closed — not because extraction was finished, but because it never finishes. New seams keep appearing as siblings grow, and each one enters the same loop: census, promote, resync. The resync commits that fill the log afterward are not churn; they are the seam receiving one upstream change at a time, which is what healthy convergence looks like. Learn to read that stream: a commit that carries new behavior is signal, a commit that converges a copy is maintenance, and confusing the two makes a living system look noisy.

Measure, extract once, guard by structure. A census turns repetition into a measurement, the kit turns the seam into one copy, and the drift test makes the boundary self-enforcing. An extraction that ends in a comment is already drifting.

Code

Census copies by shape before extracting·python
import hashlib

def census(copies: dict[str, tuple[str, str]]) -> dict[str, list[str]]:
    """Group vendored copies by shape after app-name normalization."""
    shapes: dict[str, list[str]] = {}
    for app, (text, own_name) in copies.items():
        neutral = text.replace(own_name, "<app>")
        digest = hashlib.sha256(neutral.encode()).hexdigest()
        shapes.setdefault(digest, []).append(app)
    return shapes

copies = {
    "crucible":   ("rows = PipelineRows('crucible')",   "crucible"),
    "touchstone": ("rows = PipelineRows('touchstone')", "touchstone"),
    "anvil":      ("rows = load_json('anvil.json')",    "anvil"),
}
shapes = census(copies)
assert sorted(len(v) for v in shapes.values()) == [1, 2]
widest = max(shapes.values(), key=len)
assert set(widest) == {"crucible", "touchstone"}  # extract this seam first
print(f"{len(shapes)} shapes; extract the {len(widest)}-copy seam first")

External links

Exercise

Pick one helper that lives in three or more of your own projects. Normalize each copy (names, paths), fingerprint the shapes, and write the extraction order plus the one piece of evidence that would change it.
Hint
Byte-identical after normalization is the strongest signal; a drifted copy names a seam the extraction must refuse.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.