Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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<T, TFeedback> + 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<T, TFeedback>
- 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<T, TFeedback>`, 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).
Loading