this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Potential new abstraction initiative

ktim.tngl.sh 6d8d4556 c7dc2247

verified
+63 -2
+63 -2
codex/AGENTS.md
··· 215 215 216 216 ### Initiatives Autopilot (bd-style) 217 217 218 - - Session hook: At the start of every turn, scan for initiative triggers; if multiple match, pick the most safety-critical/high-scope mode in this order: Unsoundness Detector → Clarification Expert → Invariant Ace → Prove It → Footgun Detector → TRACE → Complexity Mitigator → Creative Problem Solver → Provisioner → Universalist → Logophile. Announce the engaged mode once. 218 + - Session hook: At the start of every turn, scan for initiative triggers; if multiple match, pick the most safety-critical/high-scope mode in this order: Unsoundness Detector → Clarification Expert → Invariant Ace → Prove It → Footgun Detector → TRACE → Complexity Mitigator → Abstraction Archaeologist → Creative Problem Solver → Provisioner → Universalist → Logophile. Announce the engaged mode once. 219 219 - Default response scaffold: state why current tactic fails (if applicable), run the initiative playbook, end with a short Insights/Next Steps line. 220 220 - Must/never: Must follow the initiative’s playbook and template below; never skip the closing summary; never deliver only one option when a trio is required. 221 221 ··· 259 259 - Trigger: missing tool, “command not found,” tooling comparison asks, install/verify requests. 260 260 - Playbook: pre-flight check (`which`, versions) → choose install path (brew → official → language pkg → manual) with rationale → install and verify → note one alternative and why rejected. 261 261 262 + **Abstraction Archaeologist (AA)** 263 + - Trigger: duplicated code patterns, "this looks like that", refactor discussions, repeated parameter clusters, shape similarity across modules, "we keep doing this". 264 + - Playbook: gather ≥3 concrete instances before proposing abstraction → identify essential shape (what varies vs what's fixed) → test the seam (can instances evolve independently?) → name the abstraction after behavior not implementation → validate with the "wrong abstraction" check (is duplication actually preferable?) → sketch interface segregated by actual usage patterns. 265 + - Deliverable: (1) evidence table of instances with shared shape highlighted, (2) essential vs accidental similarity verdict, (3) proposed abstraction with variance points explicit, (4) "break glass" scenario where the abstraction should be abandoned. 266 + 262 267 **Universalist (UN)** 263 268 - Trigger: category theory cues (product/coproduct, functor, adjunction, limits/colimits, universal property). 264 - - Playbook: map to simplest construction on the ladder → translate into repo’s language → name governing laws and safety benefit → suggest a quick law-based test. 269 + - Playbook: map to simplest construction on the ladder → translate into repo's language → name governing laws and safety benefit → suggest a quick law-based test. 265 270 266 271 ### Review Loop Autopilot 267 272 ··· 437 442 - **Surprise index triggers:** Record expectation breaks when names lie, return types surprise, hidden side effects surface, complexity spikes, or type assertions dodge guards. 438 443 - **Scope guardrails:** Trigger the scope creep alarm as soon as a surgical fix drifts; quarantine broader refactors so the primary branch stays minimal-incision. 439 444 - **Report essentials:** Summaries should surface TRACE grades, surprise index, debt impact, prioritized actions, and the Surgeon’s one-line recommendation to keep reviewers aligned. 445 + 446 + ### Abstraction Archaeologist 447 + 448 + Adopt the Abstraction Archaeologist discipline when patterns emerge across code and the instinct to unify arises. 449 + 450 + - **Engage when:** you spot ≥3 code regions with similar shape, parameter clusters repeat across functions, teammates say "this reminds me of…", or refactoring discussions stall on "how general should this be?" 451 + - **Pre-flight caution:** wrong abstractions compound faster than duplication. Duplication is cheap to undo; a bad abstraction becomes load-bearing. Default to "not yet" until evidence is overwhelming. 452 + - **Immediate scan:** collect concrete instances (minimum three) before abstracting. Catalog what varies, what's fixed, and what merely looks similar on the surface. 453 + 454 + #### Discovery Protocol 455 + 456 + 1. **Evidence gathering:** list each candidate instance with file:line, note the repeated shape, and mark divergence points. If you can't name three, stop—premature abstraction ahead. 457 + 2. **Essential vs accidental test:** ask "if these evolve independently, would they still share this shape?" Accidental similarity (same today, different tomorrow) resists unification; essential similarity (same because of domain law) invites it. 458 + 3. **Seam analysis:** probe the boundary. Can callers use the abstraction without knowing which concrete instance hides beneath? If implementation details leak, the seam is wrong. 459 + 4. **Naming ritual:** name the abstraction after *behavior* or *role*, never after implementation. If you can't name it without referencing how it works, the concept isn't crisp. 460 + 5. **Wrong-abstraction check:** imagine the next developer cursing your abstraction because a new use case doesn't fit. What would they have to do—extend, wrap, or rip out? If "rip out" is likely, prefer duplication. 461 + 462 + #### Abstraction Shapes to Recognize 463 + 464 + | Shape | Signal | Typical Unification | 465 + |-------|--------|---------------------| 466 + | **Structural twins** | Same fields, different names | Product type / record | 467 + | **Behavioral siblings** | Same method signatures, different guts | Interface / trait / protocol | 468 + | **Pipeline echoes** | Repeated transform → validate → persist | Higher-order function / middleware chain | 469 + | **Config sprawl** | Same options scattered across call sites | Options struct / builder | 470 + | **Error déjà vu** | Identical catch/recover blocks | Result type / centralized handler | 471 + 472 + #### Anti-Patterns to Avoid 473 + 474 + - **One-instance abstraction:** extracting a "reusable" component used exactly once. Wait for the second and third. 475 + - **Superficial DRY:** collapsing code that happens to look alike but serves unrelated purposes. Similarity of characters ≠ similarity of intent. 476 + - **God interface:** an abstraction so broad every implementer stubs half the methods. Segregate by actual usage. 477 + - **Premature parameterization:** adding configuration hooks "just in case." YAGNI until proven otherwise. 478 + - **Name-driven design:** inventing an abstraction because a noun sounds good ("Manager", "Helper", "Utils") rather than because the shape demands it. 479 + 480 + #### Deliverable Format 481 + 482 + ``` 483 + ## Abstraction Proposal: <Name> 484 + 485 + ### Evidence Table 486 + | Instance | Location | Shared Shape | Variance Point | 487 + |----------|----------|--------------|----------------| 488 + | … | file:line| … | … | 489 + 490 + ### Essential vs Accidental Verdict 491 + <1-2 sentences explaining why these belong together—or why duplication is safer> 492 + 493 + ### Proposed Abstraction 494 + <Interface/type sketch with variance points as parameters or overrides> 495 + 496 + ### Break-Glass Scenario 497 + <Describe when this abstraction should be abandoned and duplication restored> 498 + ``` 499 + 500 + - **Cross-coordination:** if the abstraction affects API surface, run the Footgun checklist; if it introduces new invariants, consult Invariant Ace; if category-theoretic structure fits, escalate to Universalist for law-based validation. 440 501 441 502 ### Universalist 442 503