Prompting

Every lesson in this course builds one system: a stablecoin reserve attestation registry that discovers issuers, reads the PDFs they publish, and refuses to publish a field it could not read. What it is and where this lesson sits.

Tier
1 Noob
Build position
1
Throughlines
B Instruction packaging · A Context economics · G Feedback loops
Verdict
existing practice
Commit
8d37b42
Demo
scripts/terms/demo-01.ts
Runs in
the course repository

Prompting is the floor of line B, instruction packaging: where a standing instruction lives, and at what scope it binds. At this altitude the scope is one turn. A sentence is typed, the model answers, and the sentence is gone. Nothing about the next turn remembers it unless something outside the model puts it back.

That is the whole of it at altitude one, and it is worth saying plainly, because the other twenty-nine terms are all about moving instructions off that floor. Term 8 puts them in a file the harness reads on every turn. Term 15 puts them in a program that runs whether the model cooperates or not. Term 20 decides which of them the model is allowed to see at all. Every one of those is the same question at a different altitude: where does the instruction live, and what makes it bind?

The move this unit makes is the first one, and it is small enough to miss. A prompt stops being a message and becomes an artifact. A message is typed, sent and forgotten; there is nothing to point at afterwards. An artifact has a version somebody chose, a diff somebody can read, and a regression somebody can name when last week's output stops matching this week's. Nothing later in the course works until prompts are things that can be compared, which is why the mechanism below is about files and hashes rather than about wording.

The domain is a parameter

Before the mechanism, the thing that makes this course usable on your own work.

The pipeline every unit builds does five things: discover a universe of sources, fetch each one's document, extract structured fields, refuse the ones it could not read, publish what survives with provenance. None of that names a subject. It is the same shape for a folder of your notes, an API of papers, or a list of companies.

So the subject is not built in, it is passed in. src/adapter.ts defines a Domain as four functions:

discover()          // what is in the universe
fetch(item)         // get the document for one of them
extract(doc)        // pull the fields out
unreadable(fields)  // say which ones you could not actually read

Three ship with the course, and every demo takes --domain:

arxiv               0 items      0 tok  provenance {}
                   live: not attempted: this domain needs the network and has
                   no offline corpus. It will not ship invented records.
local-docs         30 items    997 tok  provenance {"local":30}
reserve-registry   30 items    927 tok  provenance {"snapshot":30}

local-docs is the default and needs nothing: no key, no account, no network. It reads a folder of text documents, and the folder is DOCS_DIR. Change that to your own and the other twenty-nine terms run against your corpus.

arxiv is the network path — pagination, rate limits, real PDFs. It has no offline corpus and will not invent one, which is why it returns zero items above rather than thirty plausible papers. A fabricated snapshot would run, pass, and teach the exact habit this course spends thirty terms arguing against.

reserve-registry is the awkward one: stablecoin issuers whose documents agree on nothing. It ships as an example of the swap against a domain that fights back, not as the thing you have to care about.

Writing your own is those four functions and a register() call. There is a test that does it in twenty lines.

The mechanism

A prompt is an input to a system whose output you will be asked to defend. That makes it evidence, and evidence needs provenance. In this repo prompts are files under prompts/, named <id>.v<N>.md, loaded by src/prompt.ts, which returns the text alongside a sha256 of the file as read.

Every artifact any run produces carries that stamp:

"prompt": { "id": "classify-issuer", "version": 1, "sha256": "7f198157afef" }

The version number in the filename is the handle a person uses. The hash is the one that cannot be forgotten. Bumping a version is a decision; changing a file is an accident waiting to be attributed to the model.

The reason is narrow and practical. When an extraction result changes, the first question is always whether the prompt changed. With a template literal three call-frames deep, that question costs ten minutes and a git blame. With a hash on the artifact, it costs one diff.

Build it

The commit does two things. src/prompt.ts loads and hashes. src/discover.ts produces the issuer universe the prompt will run against, and it is the more interesting half, because the interesting part of discovery is not the fetch.

DefiLlama is unreachable from this environment: the egress gateway answers 403. Discovery therefore falls back to a committed seed of thirty real issuers. That is fine. What would not be fine is a fallback whose output is indistinguishable from a live fetch, because six weeks later nobody can tell which records came from where, and a registry with ambiguous provenance is not a registry.

So every issuer record carries source, and the failed attempt is recorded on the result rather than swallowed:

discovery source : seed
live result      : HTTP 403 Forbidden
issuers >= $100M : 30

The live branch deliberately does not parse. Writing a parser against a payload shape nobody here can fetch would be a guess dressed as code, and the first real run would find out. It returns UNVERIFIED and says what would settle it.

The receipt

artifacts/01-discover.json. Thirty issuers, every one carrying its source, the 403 recorded verbatim, and the prompt hash stamped on the run. The demo exits non-zero if any record lacks a source stamp, so the invariant is enforced rather than described.

Where it overlaps

Line B is instruction packaging, and this is its floor: an instruction that persists as a file rather than a string. Line A is context economics, and the prompt is the largest fixed cost in every request that follows, which is why term 11 measures it and term 12 caches it. Line G is feedback loops: an artifact you can compare against last week's is the smallest possible loop, and it starts here.

A personal teaching project, in development. The registry it builds is a teaching artifact and is not an assurance opinion about any issuer. Not affiliated with or endorsed by any employer, or by any vendor whose tools it describes. Where a unit depends on a specific flag or path, it names the version it was verified against. All units.