.. _promy-prompt-feed:

*********************************************************************
PROMY:FEED --- Generic Prompt Template
*********************************************************************

:Created: 2026-03-30
:Origin: Drafted after first PROMY:SEED run on e7He
:Status: Draft --- untested


When to Use
=============

Use this prompt after PROMY:SEED has extracted the core statements
into a model directory and you are satisfied that the extraction is
complete and correct. FEED fills the remaining gaps so that GROW
has everything it needs.


The Prompt
============

Copy and adapt the following. Replace all ``{{placeholders}}``.

::

  PROMY:FEED {{MODEL_NAME}}

  **Context:** PROMY:SEED has been completed for {{MODEL_NAME}}.
  The model directory at ``source/matheology/model/{{MODEL_DIR}}/``
  now contains the files created by SEED. This FEED pass fills
  the remaining gaps.

  **Model directory (current state from SEED):**

  {{LIST ALL FILES CURRENTLY IN THE DIRECTORY WITH STATUS:
    e.g. axioms.rst (SEED-created, 14 axioms)
         symbols.rst (pre-existing, needs review)
         etc.}}

  **FEED tasks (execute in order):**

  1. **Check symbols.rst completeness.**
     Read ``axioms.rst`` and ``theorems.rst``. Extract every
     symbol used in ``.. math::`` blocks. Compare against
     ``symbols.rst``. Report:
     - Symbols used in math but missing from symbols.rst
     - Symbols in symbols.rst but not used in any math block
     - Symbols with inconsistent notation between files
     Do NOT modify symbols.rst yet --- report discrepancies
     for human review.

  2. **Check predicates.rst completeness.**
     Extract every predicate used in ``.. math::`` blocks
     (functions of the form ``\text{name}(args)``). Compare
     against ``predicates.rst``. Report:
     - Predicates used but not specified
     - Predicates specified but not used
     - Predicates with inconsistent signatures
     Do NOT modify predicates.rst yet --- report discrepancies.

  3. **Check cross-references.**
     Grep all ``:ref:`` and ``:doc:`` links that point TO this
     model from other files in the site. Check that every
     target label exists in the model directory (not just in
     the llog). Report any broken or ambiguous references.

  4. **Check models.rst accuracy.**
     Compare the submodel table in ``models.rst`` against the
     axioms in ``axioms.rst``. Every submodel listed must have
     corresponding axioms. Every axiom group must have a
     corresponding submodel entry. Report discrepancies.

  5. **Check logics.rst accuracy.**
     Compare the disciplines listed in ``logics.rst`` against
     the actual operators and constructs used in the math
     blocks. Report:
     - Logic constructs used but not listed
     - Disciplines listed but not actually used
     - Missing links to WisdomBase sheets

  6. **Fill gaps based on checking results.**
     After human reviews the discrepancy reports from steps
     1--5, apply the approved fixes:
     - Add missing symbols to symbols.rst
     - Add missing predicates to predicates.rst
     - Fix broken cross-references
     - Update models.rst and logics.rst as needed

  7. **Update aa.rst with new findings.**
     Add any issues discovered during FEED that cannot be
     resolved in this pass (e.g., predicates that need formal
     specification beyond what FEED can provide, cross-model
     dependencies that need GROW-stage resolution).
     Use the AA structure: Operational Aims section for
     structural tasks, Adversarial Aims section for formal
     testing gaps.

  8. **Update llog.rst.**
     Add a FEED entry to the model's llog.rst pointing to
     the PROMY FEED llog in HELL.

  9. **Write PROMY FEED llog to HELL.**
     Append to the existing PROMY llog (or create a new one
     if FEED is run on a different date than SEED):
     ``hell/llog/promy/promy_{{model}}_{{date}}.rst``
     Record: all discrepancy reports, all fixes applied,
     all new AA items created.

  10. **Check build.**
      Run ``make html`` and confirm:
      - Zero new warnings from model files
      - Zero duplicate labels
      - All ``:ref:`` links resolve

  **Checking checklist (MUST complete before accepting):**

  - [ ] symbols.rst reviewed: all math symbols accounted for
  - [ ] predicates.rst reviewed: all predicates accounted for
  - [ ] Cross-references: all ``:ref:`` targets exist in model
        directory (not just llog)
  - [ ] models.rst: submodel table matches axiom groups
  - [ ] logics.rst: disciplines match actual constructs used
  - [ ] aa.rst: updated with FEED-discovered issues
  - [ ] llog.rst: FEED entry added
  - [ ] HELL llog: FEED session recorded
  - [ ] ``make html``: zero new warnings from model files

  **What NOT to do during FEED:**

  - Do NOT modify axiom or theorem statements (that is GROW)
  - Do NOT write overview pages (that is REAP)
  - Do NOT reorganize axiom/theorem groupings
  - Do NOT resolve cross-model dependencies (flag them in AA
    for GROW)
  - Do NOT fix issues in files outside the model directory
    (flag them in AA)


Lessons from SEED (Informing FEED)
=====================================

1. **Symbols may use renamed variables.** In e7He, β was renamed
   to Iserendipity during the FORGE session. The math blocks still
   use β. FEED should flag this for GROW-stage resolution, not
   attempt the rename itself.

2. **Predicates may be proto-formal.** FORGE often uses predicates
   like ``\text{accepts}(h, ...)`` without a formal specification.
   FEED should catalogue these and flag unspecified predicates in AA
   rather than inventing specifications.

3. **Cross-references may point to llog.** After SEED, some site
   files may still ``:ref:`` into the llog rather than the extracted
   files. FEED should identify these but not bulk-update them ---
   the labels resolve either way, and mass updates risk introducing
   errors.

4. **Check ``vvnow`` annotation format.** The correct format is
   ``.. vvnow <value>`` (no colon = RST comment). If any file
   uses ``.. vvnow::`` (double colon) or ``.. vvnow:`` (single
   colon), fix it --- no colon is the canonical form.


Lessons from First FEED Run (e7He, 2026-03-30)
=================================================

1. **Symbol coverage gaps are large.** e7He had ~44% undocumented
   notation. Expect similar gaps in other FORGE-generated models.
   Budget time for the symbol audit --- it is the most labour-
   intensive FEED task.

2. **Functions vs. predicates distinction matters.** Symbols like
   ``scope(h,t)`` and ``game(H)`` are functions (go in symbols.rst).
   Predicates like ``sufficiently-convincing-case(h*)`` are
   behavioral criteria (go in predicates.rst). The FEED prompt's
   step 1 vs. step 2 distinction enforces this.

3. **Cross-model symbol collisions surface during FEED.** The H
   (Humanity) vs. H(X) (entropy) collision was found during the
   symbol audit. FEED should always check the reserved-symbols
   registry (once it exists) and flag collisions in AA.

4. **Inherited symbols need explicit treatment.** PET/JUB symbols
   appear in symbols.rst but not in e7He math blocks. Don't remove
   them --- they're there for cross-model coherence. But do note
   which are actively used vs. inherited.

5. **Variable renames from FORGE should be flagged, not applied.**
   FORGE sessions may rename variables (e.g., β → Iserendipity).
   FEED documents both names in symbols.rst but does NOT rename
   inside math blocks --- that is a GROW-stage modification.

6. **Check ``vvnow`` format in existing files.** The canonical
   format is ``.. vvnow <value>`` (no colon). Any colons after
   ``vvnow`` are a known bug from early output. Fix during FEED.
