Shared module defining the 7-stage post-modification pipeline. Preloaded by the modify engine. NOT user-invocable.
Defines the 8-stage pipeline that runs after every doc-modifying operation. Only the modify engine preloads this module. Other engines that modify docs (citations, api-refs, locals) run a subset.
After completing the core operation steps, execute these stages in order:
Read framework/algorithms/verbosity-algorithm.md for the execution algorithm.
Apply rules from your preloaded mod-verbosity module.
Read framework/algorithms/citation-algorithm.md for the execution algorithm.
Apply rules from your preloaded mod-citations module.
Read framework/algorithms/api-ref-algorithm.md for the execution algorithm.
Apply rules from your preloaded mod-api-refs module.
Read framework/algorithms/validation-algorithm.md for the execution algorithm.
Apply rules from your preloaded mod-validation module.
Read framework/algorithms/validation-algorithm.md for the verification algorithm.
Apply check definitions from your preloaded mod-validation module.
Follow the changelog rules from your preloaded mod-changelog module:
docs/changelog.mdFollow the rules from your preloaded mod-index module:
Pull latest, commit, and push all pipeline changes to the docs repo:
--offline: git -C {docs-root} fetch origin && git -C {docs-root} pull --ff-only. Halt if pull fails (diverged, uncommitted changes, or unreachable).
b. git -C {docs-root} add -A
c. git -C {docs-root} commit -m "fp-docs: {operation} — {summary}"
d. If not --no-push and not --offline: git -C {docs-root} push (push to remote). Halt if push fails with diagnostic guidance.Skip conditions:
--offline flag was passed, or if remote.pull_before_commit is false in system-config. Pull failure halts the operation.--no-push or --offline flag was passed, or if push.enabled is false in system-config. Push failure halts the operation with diagnostic guidance.When the orchestrate engine delegates pipeline execution, the pipeline is split into three phases across multiple agents:
| Phase | Stages | Executing Agent | Description |
|---|---|---|---|
| Write Phase | Primary op + Stages 1-3 | Primary engine (modify, citations, api-refs, locals) | Core operation + enforcement (verbosity, citations, API refs) |
| Review Phase | Stages 4-5 | Validate engine | Independent sanity-check + 10-point verification |
| Finalize Phase | Stages 6-8 | Orchestrator | Changelog, index, git commit & push |
| Stage | Phase | Agent |
|---|---|---|
| Stage 1: Verbosity Enforcement | Write | Primary engine |
| Stage 2: Citation Generation/Update | Write | Primary engine |
| Stage 3: API Reference Sync | Write | Primary engine |
| Stage 4: Sanity Check | Review | Validate engine |
| Stage 5: Verify | Review | Validate engine |
| Stage 6: Changelog Update | Finalize | Orchestrator |
| Stage 7: Index Update | Finalize | Orchestrator |
| Stage 8: Docs Commit & Push | Finalize | Orchestrator |
When executing as a teammate in a batch operation:
When running in delegated mode, engines output a variant completion marker:
Delegation complete: [verbosity: PASS] [citations: PASS] [api-refs: N/A]
This replaces the full pipeline completion marker (which is only output by the orchestrator after all phases complete).
| Operation | Stages Run |
|---|---|
| revise | All 8 stages |
| add | All 8 stages |
| auto-update | All 8 stages |
| auto-revise | All 8 stages |
| deprecate | All 8 stages |
| citations generate | Stages 4-8 (no verbosity/citation/api-ref — already done) |
| citations update | Stages 4-8 |
| api-refs generate | Stages 1, 2, 4-8 (no api-ref stage — already done) |
| locals annotate | Stages 1, 2, 4-8 |
| locals contracts | Stages 1, 2, 4-8 |
| locals shapes | Stages 1, 2, 4-8 |
verbosity.enabled is false in system-configcitations.enabled is false in system-configapi_ref.enabled is false in system-config--no-sanity-check flag was passed--no-push flag was passed or push.enabled is falseWhen the pipeline completes, output a confirmation line:
Pipeline complete: [verbosity: PASS] [citations: PASS] [sanity: HIGH] [verify: PASS] [changelog: updated] [docs-pull: pulled|skipped|HALTED] [docs-commit: committed|skipped] [docs-push: pushed|skipped|HALTED]
This marker is checked by the SubagentStop hook to validate pipeline execution.
The SubagentStop hook validates pipeline completion using these rules:
[changelog: updated] → hook emits warning[verify: FAIL] → hook emits warning with issue count[sanity: LOW] → hook emits warningFor any doc-modify operation, these files MUST have been modified:
docs/ (the target documentation)docs/changelog.md (the changelog entry)If neither changed, the operation may have failed silently.