Held together by principles.
KarnakPanel is written with AI assistance. What makes it usable is everything built around that: static analysis on every change, a disposable real server to break it on, a human who reads the diff and does the push, and structural gates that stop the codebase growing faster than anyone can understand it.
The five principles
Short enough to remember, strict enough to matter.
- 1. Read before it ships. A person reads the diff and can explain what it does and where it fits. "It works" is not an explanation.
- 2. Verify with output. Format, lint, type check, tests and the security scan. The command and its tail get pasted, not summarised.
- 3. Test on a real server. A disposable VPS, real domains, real mail, broken on purpose. Mocks agree with you; production does not.
- 4. Name what it replaces. Every change says what it supersedes. If the answer is "nothing", say so out loud — that is how a codebase triples without anyone deciding to grow it.
- 5. Push by hand. The model writes, proposes and explains. It never commits, merges or releases.
Code scanning
Static analysis on every change, security on every commit.
- Semgrep across changed code, with a local ruleset and CI parity — a finding fails the change rather than becoming a comment.
- gitleaks on every commit and over the repository, so a key cannot reach a release branch.
- Signed releases: Ed25519, verified against an install-time trust anchor. Downgrades, replays and unsigned tarballs are refused.
- Dependency checks for known vulnerabilities and unused packages before a build is packaged.
The rule that keeps this honest: fix the finding, never the check. No suppressed rule, no skipped test, no lowered threshold to get green.
Protection from code rot
Tests prove behaviour. These gates prove structure.
Every check above catches what breaks. None of them catches what accumulates. A repository can pass all of them and still triple in size with nobody able to explain it — so structure gets its own gates, running in the same hook as the security scan.
- Duplicate code — clone detection fails on new duplication above a fixed share of changed lines.
- Dead code — unused exports and orphaned files fail on introduction, not on discovery months later.
- Circular imports — any new cycle fails; existing ones are counted, not ignored.
- Size budgets — 400 lines per file, 15 cyclomatic per function. Past that, split by responsibility rather than by line count.
- Dependency drift — unused and vulnerable packages are surfaced before they become permanent.
- Written down — an architecture map, a glossary and a canonical-helpers list, so new code extends what exists instead of inventing a fourth version of it.
Ratchet, don't retrofit. Existing findings are baselined and paid down on a schedule. New ones fail immediately. That is what makes these gates adoptable on a codebase that is already imperfect — this one included.
Human tested, human read, human pushed
Where the responsibility actually sits.
- Tested — the maintainer installs the build on a fresh server and uses it: creates domains and mailboxes, pushes mail through the real MTA, breaks things deliberately, wipes the box.
- Read — the diff is read before it is staged. If it cannot be explained in two sentences, it does not merge.
- Pushed — by hand, after the verification chain. The model has no push rights.
- Rolled back — every update snapshots first; a failed health check restores automatically.
What the gates have caught
Defects found before users, which is the only useful measure of a process.
- A login timing leak — response time varied enough to distinguish a valid account from an invalid one.
- An XSS in the file manager — a filename rendered unescaped in one view.
- A notification system that had never fired — one ambiguous SQL column meant the query silently returned nothing, for months.
None of these were visible in a demo, and all three are the failure mode that AI-assisted development produces: confident, plausible, and wrong only once it runs.
What we don't claim
The limits, stated plainly.
Read it yourself
None of the above needs to be taken on trust.
The mechanisms are described on the security page, the install is one command in the docs, and the source is on GitHub. Found a hole, a bit of rot, or a claim that does not match the code? Email it or open a ticket.