diff --git a/docs/pr-discussions/PR-5523-docs-rule-function-is-tiny-control-flow-generator-ocp-applie.md b/docs/pr-discussions/PR-5523-docs-rule-function-is-tiny-control-flow-generator-ocp-applie.md new file mode 100644 index 0000000000..09bdc0ce7f --- /dev/null +++ b/docs/pr-discussions/PR-5523-docs-rule-function-is-tiny-control-flow-generator-ocp-applie.md @@ -0,0 +1,84 @@ +--- +pr_number: 5523 +title: "docs(rule): function-is-tiny-control-flow-generator + OCP-applied-to-control-flow \u2014 structural foundation underlying day's substrate-engineering cluster (operator 2026-05-27)" +author: "AceHack" +state: "MERGED" +created_at: "2026-05-27T17:34:40Z" +merged_at: "2026-05-27T17:40:51Z" +closed_at: "2026-05-27T17:40:51Z" +head_ref: "backlog/function-is-tiny-control-flow-generator-ocp-applied-to-control-flow-2026-05-27" +base_ref: "main" +archived_at: "2026-05-27T17:46:56Z" +archive_tool: "tools/pr-preservation/archive-pr.ts" +--- + +# PR #5523: docs(rule): function-is-tiny-control-flow-generator + OCP-applied-to-control-flow — structural foundation underlying day's substrate-engineering cluster (operator 2026-05-27) + +## PR description + +## Summary + +Operator-explicit \"ship whatever makes sense we just figured it all out +lol\" authorization. Two carved-sentence-grade insights from the day's +final substrate-engineering thread: + +> *\"every function is a tiny control-flow generator\"* + +> *\"this is open-closed principle applied to control flow\"* + +Both compose into the STRUCTURAL FOUNDATION underlying today's full +substrate-engineering cluster (asymmetric-authorship + monad- +propagation + OPLE-T-TFeedback + Result + exceptions- +as-signals + iterator/generator-asymmetry). + +## What the rule lands + +- 9-row function-as-control-flow-generator level mapping +- 4-row OCP-property mapping for Result +- 8-row framework-OCP-applied-to-control-flow instantiations table +- Day's full 6-carved-sentence stack with both this rule's carved + sentences as structural foundation +- 5-step operational discipline for substrate-engineering work +- Composition with 7 substrate items + 8 framework rules + +## Test plan + +- [x] Markdownlint clean +- [x] Substrate-inventory pass per verify-existing-substrate-before-authoring +- [x] Composes with today's 14-PR cluster + cross-AI synthesis PRs +- [ ] CI passes (auto-merge to fire on green) + +🤖 Generated with [Claude Code](https://claude.com/claude-code) + +## Reviews + +### COMMENTED — @copilot-pull-request-reviewer (2026-05-27T17:37:14Z) + +## Pull request overview + +Adds a new `.claude/rules/**` rule documenting two carved sentences (“every function is a tiny control-flow generator” and “TFeedback is OCP: open for extension, closed for modification”) as structural framing for the broader Result/TFeedback substrate-engineering cluster. + +**Changes:** +- Introduces a new rule file with mappings/tables that relate function shape, `Result`, and caller composition (`Result.bind`). +- Captures an OCP-to-control-flow mapping and lists several framework-level instantiations. +- Adds an operational discipline checklist and composition links to related rules/backlog items. + +## Review threads + +### Thread 1: .claude/rules/function-is-tiny-control-flow-generator-ocp-applied-to-control-flow.md:88 (resolved) + +**@copilot-pull-request-reviewer** (2026-05-27T17:37:13Z): + +P1: This rule file is a current-state surface (`.claude/rules/**`), but it introduces direct persona/contributor names (e.g., “Amara”). Per `docs/AGENT-BEST-PRACTICES.md` Operational standing rule “No name attribution in code, docs, or skills” (around lines 671+), please replace these with role-refs (e.g., “the documentation shepherd”, “the agent”) and/or link to the relevant PR/backlog artifact for provenance, keeping names confined to the allowed history surfaces. + +### Thread 2: .claude/rules/function-is-tiny-control-flow-generator-ocp-applied-to-control-flow.md:9 (resolved) + +**@copilot-pull-request-reviewer** (2026-05-27T17:37:14Z): + +Minor grammar: “preserve semantic” should be “preserve semantics”. + +## General comments + +### @chatgpt-codex-connector (2026-05-27T17:34:44Z) + +You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage).