# Secret page
## What this builds
A single HTML file (with its script and styles inline, or beside it in a
tiny folder) that hides a secret behind a password. The file is
self-contained: opening it does not need a server, and the checks do not
need a network. A wrong password fails. The right password reveals the
fixture secret. The secret in the shipped fixture is a harmless phrase,
not a real credential.
Read `spekkr.inputs.json` first. `title` is on the locked page. `hint` and
`hint_on` control a hint. `attempts` caps tries. `kdf` chooses how the
verifier is checked. The fixture password and secret are in a test-only
file, not printed on the page.
## Out of scope
- A real production vault, a password manager, or storing real credentials
in the shipped fixture.
- A network unlock or a third-party auth.
- Recovery of a forgotten password in this version.
## Requirements
Each requirement has an id. Checks name the id they cover.
### R1. Wrong and right
- The fixture file, opened (or loaded) without a server, shows the locked
page. A wrong password shows a failure and does not reveal the secret.
- The right password, from `fixtures/secret-page.json`, reveals the exact
secret string in that file.
- The secret is not present in plaintext in the shipped HTML; only a
verifier and a ciphertext are.
Accept when: wrong fails, right reveals the exact secret, and a scan of
the source does not contain the secret string.
### R2. Limits, self-contained, frames
- If `attempts` is on, a documented number of wrong tries (5) disables the
form until a reload. The sixth try is not checked.
- A fetch hook fails if any host is contacted while unlocking.
- Goldens: locked, a wrong attempt, the revealed secret, and the limited
state. One command runs the cases, the source scan, the hook, and writes
the frames. No network and no server required.
Accept when: the fifth wrong try locks the form, the hook stays quiet, and
the four frames match the goldens.
### R3. Inputs
- The build reads `spekkr.inputs.json`. Settings label the UI, options
turn features on or off, and a swap must be one of its choices.
- A value outside a stated range, or a swap that is not one of its
choices, is refused before the app starts its checks, with a message
that names the key.
Accept when: the default inputs render, an illegal swap is refused by
name, and changing a visible setting (for example the title) shows up in a
later check.
### R4. Checks and report
- One command runs every acceptance check at the defaults and at the
person's inputs, including golden frames where a requirement asks for
them.
- Checks do not need a network, a paid API, or physical hardware.
Accept when: the command passes at the defaults, and a deliberately broken
fixture or a wrong price fails it.
## Verification
A wrong password fails and a right password reveals the fixture secret.
The shipped file does not contain the secret in plaintext. The page is
self-contained: no server and no network, with a fetch hook to prove it.
An attempt cap is tested. The fixture secret is harmless.
## Definition of done
- Every acceptance check above runs from one command, and all pass at the
person's inputs.
- A README says how to build a new locked file, how to run the checks, and
that real credentials must not be shipped as fixtures.