Review (2026-07-26): approved as the tool-lane template by Nicolas Burri (C-V2 red-pen round; QMS/engineering domain-expert review, no legal-counsel claim — legal review deferred to before any commercial distribution).
AI-Authorship Posture — How LQMS Is Built, and Why the Validation Evidence Does Not Rest on It (TEMPLATE)¶
Tool-lane TEMPLATE, free of any organisation's specifics. It states, honestly and for the record, that LQMS is built primarily by AI implementation agents, what that does and does not mean for the trustworthiness of the tool, and where human accountability actually sits. It is the third companion to the two other C-V2 documents (intended-use.md, tool-risk-assessment.md) and, like them, is intended to be released inside LQMS itself as a controlled document through the ordinary life cycle (the C-V2 path, ADR-0061 §2/§3) — whether as its own controlled document or as an addendum to the tool-risk assessment is an open point. It answers the mock-audit HQ-4 ("AI wrote this code — who is accountable?").
Who authored what, and who decides, differs per installation and per period, so those values are declared template fields (§2). This document references no instance document — see the lane rule.
Status: working draft for review, not yet a controlled document.
Norm handling: standards (ISO/IEC/EN) are paraphrased with clause citations only; no verbatim normative text (conventions.md; ADR-0061 D-5).
1. Purpose and frame¶
This document states the authorship posture of LQMS: the tool's code, its documentation, and most of its tests are written by AI implementation agents ({{aiAuthors}}), coordinated by a reviewing role ({{reviewCoordinator}}), with a human making every design decision ({{humanDecider}}). That is an unusual thing to disclose to an auditor, so we disclose it plainly rather than let it be discovered — the honesty is the point (the same discipline the tool applies to its own gaps).
The frame is the same ISO 13485 §4.1.6 duty the other two C-V2 documents serve: the organisation using LQMS in its QMS — here {{organisation}} — validates the tool for its intended use, proportionate to risk, before use and after changes. AI authorship is not a separate regulatory category — a QMS tool is validated by what its evidence shows it does, not by who or what typed it. This document's job is therefore narrow and specific:
- Say what is AI-authored and what the human-decision layer is (§3).
- Describe the gate structure that bounds what AI output can reach a release (§4).
- Show why the validation evidence does not depend on trusting the authorship process — it is anchored in tagged git + CI, not in a model's say-so (§5).
- Name the honest residual — the failure modes AI authorship really does introduce, and the mitigations that bound them (§6).
LQMS is not medical-device software and this is not a claim about a regulated product. The GAMP-5 / tool-validation vocabulary is borrowed because that is the language auditors expect.
2. Instantiation fields¶
organisation | Organisation stating this posture | yes |
aiAuthors | AI implementation authorship (models and agent roles) | yes |
reviewCoordinator | Reviewing / coordinating role — the pass separate from authoring | yes |
humanDecider | Named human decider (person and role) | yes |
releaseSignatory | Who signs the release approval / validation report | yes
Mechanics (template-vars declarations + brace placeholders, camelCase keys):
ADR-0049 §2 and the
field guide. The instantiation also records how the roster
is evidenced in its own record (commit trailers, decider lines, worklog) — see §3's last bullet.
3. What is AI-authored — and the human-decision layer¶
AI-authored:
- Code. The Kotlin/Quarkus backend, the jOOQ persistence layer, the Angular frontend, the migrations, and the deploy tooling are written by implementation agents against a pinned design.
- Documentation. The arc42 architecture sections, the ADRs (drafted by agents), the user guide, the requirement tables, and the validation package prose are agent-authored.
- Tests. The unit, integration, architecture (Konsist), row-level-security separation, projection property, and end-to-end (Playwright) suites are agent-authored — including this validation package's generator and its own test suite.
The human-decision layer (this is the load-bearing part). Authorship is not the same as decision. Every architecturally significant choice is made by a human — {{humanDecider}} — and the process is structural, not informal:
- The options → decision → ADR rhythm. Agents present genuine alternatives with a recommendation; the human decides; the decision is recorded as an ADR before implementation (conventions.md; the "no decision by default" rule). Every ADR carries a named human decider on its decider line. The agent implements the decided design — it does not invent architecture per feature (agent-quality-practices.md §3).
- Challenge the premise. An agent that finds a brief contradicting the record or an ADR must stop and say so rather than build on a premise it doubts (conventions.md; precedent ADR-0076, where a briefed table was correctly not built). Decisions are not rubber-stamped by the machine.
- Name the honest cut. Every work unit records what was deliberately not built and why, in STATUS/worklog — so an omission reads as a decision, not an oversight.
- The record shows the human chain. Commits (with
Co-Authored-Bytrailers naming the AI author), ADR decider lines, the worklog, and the release approval block (the report §9) together are the accountability trail. The tool does not self-approve: the validation report becomes a controlled record only when a human signs it ({{releaseSignatory}}; report §9 — a v1.0 wet-signature gate, ADR-0090 §1).
So the accountable party is human and on the record at every gate that matters: the design decision, the release approval, and the sign-off.
4. The gate structure that bounds AI output¶
AI output does not reach a release on trust; it reaches a release by surviving gates a model cannot talk its way past. The governing principle (conventions.md; agent-quality-practices.md) is: enforce structurally wherever a correct rule can be written; review adversarially where it cannot.
- Architecture conformance in the build (Konsist). Layering is a build gate, not a review note:
JAX-RS annotations outside the API module, generated jOOQ types outside
*Repositoryclasses, repositories referenced from the API layer, filesystem access outside the storage module — each fails the build. An agent that writes un-layered code produces a red build, and red builds do not merge. The agent does not need to agree with the rule; it is unable to violate it. - The data-separation suite (the top quality goal). Mandator/project separation is enforced in
the database by row-level security, independent of application code, and negative-tested:
RlsSeparationTestandRlsConnectionReuseTestfail if a policy is weakened (ADR-0009/0026/0027). An AI change that eroded separation would break the suite, not slip through. - Behavior-frozen suites. Test suites freeze behavior (and e2e asserts invariants, not pixel geography), so refactors run the full affected suites before and after and prove unchanged counts. The tree-as-record projection property tests pin the content model. This is what makes agent cleanups safe rather than risky (agent-quality-practices.md §6).
- Supply-chain and licence gates. Permissive-only licence enforcement on both stacks and a triage-aware grype gate that fails closed on any ≥ High finding lacking a recorded decision (ADR-0062; report §4/§6) — a machine-checkable boundary on what dependencies AI-authored code may pull in.
- The full-stack smoke. Real Chromium against the served SPA with a real BFF/OIDC login proves the wired system, not just unit-level claims (report §4).
- The adversarial review loop. Reviews are two-stage — find, then try to refute each finding before acting — and every review wave includes a dedicated simplicity pass (restate the intent, ask "what is the least mechanism that satisfies it?", flag every over-abstraction). Findings are not taken on authority; they must survive an opposed check, and may be refused on evidence — an implementation agent recently declined a "cleanup" because the reviewer's premise was wrong, which prevented a regression (conventions.md "Review waves"; agent-quality-practices.md §5). Crucially the review pass is a separate pass from the authoring pass (a different model instance in the planning/ review role, {{reviewCoordinator}}), so the check is not the author grading its own work.
- The ratchet. When a review finds a rule-shaped problem, the fix ships with a new gate (a Konsist rule, a test), retiring the defect class permanently rather than fixing one instance (agent-quality-practices.md §2). The gate set grows monotonically as AI failure modes are found.
- The release ritual. A release is a deliberate human act, not every merge (ADR-0090 §2): cut the tag, the tag-gated jobs run, the report is generated at the tag, a human signs §9. Nothing becomes a validated release state without a human pulling that lever.
5. Why the validation evidence does not depend on trusting the authorship¶
This is the heart of the posture, and the answer to the "isn't it circular?" objection (mock-audit HQ-1): the validation evidence is anchored in tagged git and CI, not in the model's self-report.
- A deterministic generator. The traceability matrix and the release-validation report are
produced by a deterministic generator (
scripts/generate-traceability.py, ADR-0061 C-V1a): same inputs → same output, everything sorted, the only generation-instant data being the timestamp and the point-in-time CI evidence references. It parses the requirement tables, scans the code and git history for requirement-id citations, merges the curated overrides, and derives each requirement's verification status. It is not a model narrating what it believes; it is a mechanical derivation over the committed artifacts, and it has its own test suite (scripts/test_generate_traceability.py) run in CI. A reader can regenerate it and get the same bytes. - Execution is the evidence. A requirement's verification is not a citation; it is a citation plus an executed, passing run of the cited test in the verification pipeline (report §7, "execution is the evidence"). The gates in .github/workflows/ci.yml run on every change; the release tag pins the exact commit; the passing run is the retained record (archived locally per ADR-0090 addendum, so the evidence survives even if the CI host's logs expire — mock-audit HQ-3). Whether a human or a model wrote the test, the test either passes against the real system or it does not.
- The circularity is broken by the anchor. LQMS's requirements are managed in LQMS, and the C-V2 documents are authored in LQMS — deliberate dogfood. But the supplier validation record (the release report, generated from tagged git + CI) lives outside the running tool and is verified by an independent pipeline; the C-V2 documents are validated against that supplier evidence, not by themselves (ADR-0061 §1–§3; the companion intended-use specification §1). The anchor is the git/CI baseline, not the app's or a model's self-assessment. By the same token, this is not "the AI grading its own homework": the grade is a pipeline result over committed code, reproducible by anyone with the repository.
The practical consequence: an auditor does not have to form an opinion about how much to trust AI authorship in order to accept the evidence. They can re-derive the matrix, read the tests, and check that the pipeline ran — the trust question is replaced by a reproducibility question.
6. Honest residual — the failure modes AI authorship really introduces¶
The gates above are not a claim of perfection. AI authorship has novel failure modes, and pretending otherwise would defeat the purpose of this document. The honest residual:
- Specification-distance ("misses the point"). A model can answer a question near the one asked — plausible, well-formed, and wrong at the level of intent. Mitigation: the ADR-before-implementation rhythm shrinks the failure from "wrong architecture" to "wrong details" (details are cheap to fix); the pinned design is the brief, and deviations must be reported, not silently made (agent-quality-practices.md §3).
- Plausible-but-wrong output that reads as correct. AI text and code are fluent, which can mask an error better than a junior human's would. Mitigation: nothing merges on fluency — it merges on a green pipeline and an adversarial review that must refute before it accepts; claims that cannot be mechanically checked (e.g. frontend component reuse) are the ones review must catch by hand, and we say so plainly (agent-quality-practices.md "Honest calibration": backend layering is guaranteed by a gate, frontend reuse is not).
- Over-abstraction / speculative generality. Models sometimes build more mechanism than the intent needs. Mitigation: the dedicated simplicity pass in every review wave exists precisely for this (conventions.md "Review waves").
- Stale review conclusions. A finding can describe code that no longer exists. Mitigation: reviews anchor on current code and stale findings must die in verification (agent-quality-practices.md "Honest calibration").
- Automation bias in the human loop. The human decider could rubber-stamp fluent output. Mitigation: the decision points are structural (ADR + named decider + wet-signed release), the challenge-the-premise rule licenses the agent to push back, and the mock-audit rehearsal itself (the walkthrough) is a periodic adversarial stress-test of whether the story actually holds — a stumble scored honestly there is the intended output.
- Residual, stated plainly: the loop makes the miss rate low and the misses cheap; it does not replace a human who knows what the team can maintain. "Maintainable" is partly taste, and the final arbiter is the human team that will read the code in a year (agent-quality-practices.md). None of this is 100% — the claim is a bounded residual with the bound made of gates, human decision points, and rehearsal, not an absence of risk.
If a recorded-judgment token is wanted for the tool-risk table (should this be folded there rather than stand alone — see §8), the row is "AI authorship introduces an undetected defect into a released control", and the rationale available to the instantiating organisation is: the material controls (RLS separation, lifecycle, effectivity) are each independently gate-tested and negative-tested, so an undetected authorship error would have to survive a gate specifically written to catch its class. The token itself is recorded by the instantiation, not by this template — the scale and the calculus belong to the organisation's risk policy (ADR-0079 doctrine: the tool records a judgment, it does not compute a score).
7. The same posture applied to AI-authored QMS content¶
(Generalisation of §3–§6 for an organisation whose own controlled content is partly AI-authored — not part of the original supplier-side posture; see §8.) The pattern transfers without change: disclose what is AI-authored rather than let it be discovered; keep the decision human and named (LQMS records the author, the approver and the change description per version, and four-eyes makes the releaser structurally not the author); let the tool's structural gates — review policy, frozen released content, derived-never-stored status, version-precise acknowledgement — bound what AI-drafted content can become without a human act; and anchor the evidence in the audit trail and the export manifests rather than in an assertion about how the text was produced. Attribution of AI-drafted content belongs in the version's change description, where it is part of the controlled record.
8. Open points for the red-pen round (template-level)¶
- Standalone document vs. tool-risk addendum. HQ-4 called this a "candidate for a short C-V2 addendum." It is drafted as a standalone companion so the posture is stated in one place, but it could instead become a new TR-010 row + a short narrative section in the tool-risk assessment. The recommendation is standalone (the posture is a policy statement, not only a risk), but it folds if one fewer document is preferred.
- How much model detail to name. The
aiAuthors/reviewCoordinatorfields let an instantiation name specific models — which then need change control as they rotate — or stay at the level of roles, which ages better. Confirm which the controlled version should carry. - Framing as a strength vs. a disclosure. This is written as an honest disclosure that happens to be defensible, not as a marketing claim that AI authorship is better. Confirm that tone is what belongs in front of an auditor; the alternative (leading with the gate story as a strength) is available but risks over-claiming.
- Scope boundary with the other two C-V2 documents. This document deliberately does not restate the intended use or the tool-risk mitigations — it points at them. Confirm the cross-references land where they should, and whether the release order should be all three C-V2 documents together.
- §7 is new in this restructuring — a faithful generalisation of the posture pattern to an organisation's own AI-authored QMS content, added because a template is read by organisations that will ask the question about their own documents. It carries no claim the original draft made. Cut it if the posture should stay strictly about how the tool is built.
Template prepared as C-V2 input, not a controlled document. Regulatory frame: ISO 13485 §4.1.6 (validation of QMS software, proportionate to risk), §4.2.5 (records). Governing decisions referenced: ADR-0061 (CSV validation package — the C-V1/C-V2 split and the deterministic generator), ADR-0090 (release & versioning, the human-signed release ritual), ADR-0062 (SBOM / supply-chain gates), ADR-0009/0026/0027 (RLS separation), ADR-0079 (recorded-not-computed risk scores). Practices sources: conventions.md, agent-quality-practices.md, architecture-worldview.md.