docs/PLAN.md is the spec: no design judgment; anything unclear is a question in the PR, not a guess.
- Public API: typed (no
any/interface{}), explicit, sequential, minimal; no generics ([T any]) orreflectwithout benchmarked allocation/performance justification and owner approval; never export a symbol only a test uses. - One intent, one path: the old path is deleted in the same change. No silent fallback,
TODO, commented code or stub. - Fail at compile time, else a loud diagnostic — never silently. Zero values deny.
- A defect in a dependency is reported, never wrapped or patched here.
- No string literals in logic: named constants. The same logic never lives in two repos: import the package the plan names; if you find an existing one the plan does not name that already does what you are about to write, say so in the PR instead of writing it.
cmd/*/main.go: parse flags, inject, print/exit only. stdout = data, stderr = logs, exit codes are the contract.- WASM code:
webtyp/fmt,webtyp/time,webtyp/jsoninstead of stdlib (imported without alias asfmt,time,json— nevertinytime); nomap;dom.Elementembedded by value. css.go,svg.go,js.go,html.gocarry//go:build !wasm; nossr.go, nofront.go.- Build tags:
wasm/!wasmonly when the API does not exist on that platform;browser/!browserwhen an app's file belongs to another binary; a library carries no destination tag (the linker drops what a binary never calls). One main per folder, no destination tag:web/browser/main.go→web/public/browser.wasm,web/server/main.go→web/server/server,web/edge/main.go→web/edge/edge.wasm. - Code and keys in English; UI text is
lang.Text, translations live inlang.json. Comments and docs: English inwebtyp/*; inveltylabs/*every README,docs/*file, diagram and code comment is in Spanish, written for a reader with little technical background, and each exported symbol's comment shows a short usage example. - A translation key is reused, never duplicated as a near-identical phrase (
"not a valid integer"+"not a valid decimal number"repeats"not a valid"three ways instead of composing it once) — every library ships to WASM/TinyGo, so each unreused phrase is dictionary rows AND binary bytes, in every consumer, forever. A token that doesn't need translating (a kind/type name likeint) is passed as data (a variable), never as a string literal — a literal becomes a dictionary key whether or not it needed one. - Tests cover behaviour and domain rules, never the look (CSS, colours, markup order, class strings). In
tests/(external package), real stack with fakes only at the edge; rungotest. - Docs (
README.md,docs/*) updated with the API; permanent docs never linkdocs/PLAN.md. - Before the PR:
git diff --stat mainlists every file of the plan's stages, and nothing the plan did not order is deleted.
webtyp.com/securityeventis an isomorphic contract library: the same code runs in the browser and on the server. It imports onlyevents,model,msgtypeandtimefrom webtyp; never stdlibtime,fmtorerrorsin non-test code.- It does one thing: name security events and carry them over an
eventsbroker. It never writes logs, counts, blocks or alerts; the composition root's subscriber does (appkit). Kindnumbers are stable: append new kinds at the end, never reorder or reuse one. Every kind has an OWASP-styleNameand aLevel.- An
Eventnever carries a secret: no password, token, session id or what the person typed.Reasonis a named constant of the reporting package. - A zero
Reporterrefuses every report (ErrReporterNotCreated); do NOT make it "work" by dropping events.