# SUPERSEDED — DO NOT EXECUTE — historical P1-0b agent prompt

> P1-0b is complete. This file preserves the assignment evidence as history only. Its commands,
> branch references, gates, and output directives are not current instructions. Read
> `docs/PROJECT-STATE.md` for current state.

# Developer agent prompt — Sibyla v5.0, assignment P1-0b (historical)

Hand this to the coding agent on the **development machine**, working in
`D:\fileStorage\repos\GOTT.Sibyla`, branch `feature/document-type-settings`. Paste as the opening
message of a fresh session.

---

## What this assignment is

The P1-0 design freeze was reviewed against the pinned FDR prototype on 2026-08-04. The review found
**19 blocking defects** — ten of them proven to fail on counted rows at import — and every one has a
decision recorded.

**Your job is to apply those decisions to the drafts. Nothing else.**

This is not a redesign. Every decision is already made, with its evidence and its rationale written
down. You are transcribing settled conclusions into normative documents that currently contradict
them.

**Read first, in this order:**

1. `docs/p1-0-corrections.md` — **C1 through C19. This is your work list.** Each entry ends with an
   "Applies to" line naming the draft and section.
2. `docs/p1-0-review-findings.md` — the evidence behind each correction, if you need to understand
   *why* before you edit.
3. `docs/p1-0-vocabularies.md` — normative, generated from the pin. Every literal comes from here.
4. `AGENTS.md`, then the six drafts you are editing.

If `docs/p1-0-corrections.md` is not in your checkout, **stop and report it.**

---

## Ground rules

**The corrections win.** Where a draft contradicts a C-entry, the draft is wrong. Do not soften, do
not reconcile, do not add "the draft may also mean…". Rewrite.

**Do not re-derive.** The measurements in the corrections were taken against the prototype at
`9359c67` (re-confirmed at `6146004`). Do not re-run them to check. If you believe a measurement is
wrong, **report it — do not act on your own recount.**

**Do not extend scope.** If applying a correction reveals a *new* defect, write it in your status
document as a proposed C20+ and leave it. A review found these nineteen; a twentieth needs the same
scrutiny, not an inline fix.

**Known deferred debt — deliberately out of scope.** `docs/p1-0-residual-triage.md` lists ~40 further
findings, triaged A (blocks import, 7) / B (blocks production, 15) / C (tidy-up, 18). **A conscious
decision was taken to ship C1–C19 first and defer all of them.** Do not fix them, do not mention them
as blockers in your output, and do not let them slow this assignment. Two exceptions, both narrow:

- **Item C of the triage (18 tidy-up items) may be applied** if you finish C1–C19 with room — they are
  wording, counts and internal tidiness, each a one-line fix, and none needs a decision.
- **If you physically cannot apply a C-entry because a triage-A item blocks it**, stop and say so in
  the status document. Do not invent the missing piece. The likeliest case is **A1**: the FDCHDR
  source-fiscal identity index `(Company, Entity, NormalizedDocumentID, FlowType)` names three
  components that do not exist as stored fields. If a C-entry requires you to restate that index,
  record the blocker and move on.

**Documentation only.** No `src/` changes, no migrations, no database. This assignment does not
authorize P1-1.

**Preserve the drafts' voice and structure.** These are review-ready normative documents that a human
will sign. Edit in place; do not restructure, do not reformat, do not "improve" untouched sections.

---

## The work

### A. Apply C1–C19

Work them in order. For each: read the C-entry, open the file named in "Applies to", make the change,
and record it in your status document. Several entries touch more than one file — C4 touches every
draft that names a literal.

Three C-entries **rewrite text the freeze declared settled**, and those matter most because a reader
who trusts the summary will never look further:

- **C2** rewrites **decision 18** (ENTITM `EntityCode` semantics — inverted, not incomplete).
- **C3** rewrites **decision 9** (`EnforcementStartsAt` vs the FDR `EffectiveFrom`).
- **C9c** rewrites **decision 1** (`Invoice-Receipt` keeps its hyphen).
- **C15** completes **decision 10** (RelatedParty needs a rule and a DOCEFL entry, not a column).

### B. Derived work the corrections imply

These follow from the decisions but are not themselves edits to a paragraph:

1. **Regenerate the DOCTYP seed** (C9) as a **superset of the pinned 19 rows** plus
   `Duplicate | External`. The current seed drops 8 live types and renames 2. Add the separate
   condition field the conditional `Fiscal eligible` values need — five of them cannot live in a
   `bool`. `AutoActionAllowed` has the same shape (C4) and needs the same treatment.
2. **Add the `EF0000000` sentinel** to the DOCEFL seed (C11).
3. **Add the RelatedParty DOCEFL rule** (C15), Information / Non-Blocking, written against the real
   `CLCode`s for `Banks / Financing` and `Revenue / Intercompany`.
4. **Add the gap-detection DOCEFL rule** (C12) that replaces the OFDGAP table, preserving the
   Monthly-only scope, and remove OFDGAP from the roster as a table.
5. **Expand `DOCEFL.AppliesToTable`** one row per pair (C4), the same way DOCTYP expands OriginClass.
6. **State the reconciliation-rate definition** as a view or generated column (C18a), with the
   **55.9%** baseline and the note about the 94.6% divergence. Restate P1-11 acceptance against it.

### C. Update the summary and the checklist

`docs/p1-0-design-freeze-summary.md` currently says *"There are no unresolved domain-choice questions
and no other external blockers."* That is no longer true and was not true when written.

- Correct the 19 captured decisions where C-entries changed them.
- Correct the self-review table. Five rows were over-claimed: `RelatedParty`, `Grandfathering D7`,
  `Roles policy`, `Codes and LGCode`, `Required flow SVG`.
- Historical output directive, now closed: the assignment asked for a short section listing what
  the corrections then marked as **still needing Luís**. All C1–C19 decisions were subsequently
  closed, and nothing on the .NET side is currently blocked on Luís; do not emit such a list now.

### D. Two withdrawn findings — do not "fix" them

The review corrected itself twice. **Both drafts were right and the review was wrong:**

- **ENTBNK** (C8): the comma-join model is correct. The 5 duplicate rows are a data defect at source,
  not a modelling requirement.
- **RelatedParty funding classification** (C15): it exists in ITMCLS. The draft needed to reference
  it, not define it.

If you find text in the review findings that still asserts the withdrawn version, leave the findings
document alone — it is a dated record, and both entries are already marked as withdrawn.

---

## Definition of done

- All 19 C-entries applied, each recorded in `docs/p1-0b-status.md` with the file and section touched.
- The four settled decisions (1, 9, 10, 18) rewritten in the summary.
- The DOCTYP and DOCEFL seeds regenerated per section B.
- Every literal in every draft traceable to `docs/p1-0-vocabularies.md`. **Grep for the known-bad
  ones before you finish:** `NonBlocking` (unhyphenated), `Receivables` as a `DocClass` value,
  `Invoice Receipt` without the hyphen, `char(64)` on `SourceTextHash`, `DocLogId`, `PaymentSequence`
  on a control header.
- No `src/` change, no migration, no database action, no P1-1 work.
- Any new defect found while editing recorded as a proposed C20+ and **not** fixed inline.
- Focused commits on `feature/document-type-settings`, staged by explicit path. Never `git add -A`.
  Do not merge to `main`.

Report back with the status document. Do not proceed to P1-1 — that is a separate assignment with its
own prompt, and it stays behind the P1-0 sign-off.
