-
Notifications
You must be signed in to change notification settings - Fork 3
docs: Phase 7 Final Validation & Complexity Update #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mkalhitti-cloud
wants to merge
7
commits into
main
Choose a base branch
from
feat/phase7-final-validation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+64,240
−1,139
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b066ded
docs: update architecture and task status for Phase 7 completion [111…
mkalhitti-cloud d5a5216
feat(tests): Ticket 03 - Phase 2 Event Processing tests (T05-T09)
mkalhitti-cloud 2ee3e91
feat(tests): Add Phase 3 Contract Tracking tests (T10-T13)
mkalhitti-cloud dbe6e8d
feat(tests): Add Phase 4 Edge Cases tests (T14-T17)
mkalhitti-cloud 5b5c6d8
feat(tests): Add Phase 5 Integration tests (T18-T20) - EPIC COMPLETE
mkalhitti-cloud 6188990
chore: parameterize bug-bounty command and update workflow docs with …
mkalhitti-cloud dc6ba49
workflow: apply pattern-first prompt refinements for architectural sy…
mkalhitti-cloud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| --- | ||
| description: Execute a single complexity extraction ticket using the full P2-P6 TDD Red-Green-Refactor pipeline. | ||
| argument-hint: <traycer-ticket-content> | ||
| --- | ||
| # MISSION: Bob TDD -- V12 Photon Kernel Complexity Extraction | ||
| **Spec Ref**: docs/brain/bob_tdd_workflow.md | ||
| **Protocol**: V12 Photon Kernel DNA (Lock-Free, ASCII-Only, TDD Red-Green-Refactor) | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 1 -- P2 FORENSICS (Plan Mode) | ||
|
|
||
| Before writing any code or plan, run forensic analysis: | ||
|
|
||
| ### 1a. jCodemunch Structural Scan | ||
| - `get_file_outline` on the target file -- map every symbol, signature, complexity score | ||
| - `get_blast_radius` on the target method -- identify all downstream callers | ||
| - `find_references` on any shared state accessed in the method | ||
|
|
||
| ### 1b. Complexity Baseline | ||
| Run: `python scripts/complexity_audit.py` | ||
| Record the BEFORE CYC score for the target method. | ||
|
|
||
| ### 1c. Graphify Caller Map | ||
| Run: `graphify update .` | ||
| Read `graphify-out/GRAPH_REPORT.md` -- confirm caller impact scope. | ||
|
|
||
| **Output**: Write `docs/brain/forensics_report_t[ID].md` with: | ||
| - Target method name + current CYC score | ||
| - Blast radius (callers list) | ||
| - Proposed extraction boundary (helper name + signature draft) | ||
| - DNA risks identified | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 2 -- P3 ARCHITECT PLAN (Plan Mode) | ||
|
|
||
| Produce a written implementation plan: | ||
|
|
||
| ``` | ||
| ## Bob TDD Plan: [ticket ID] -- [method name] | ||
| ### Extraction Design | ||
| | Helper Name | Signature | Lines Extracted | CYC Impact | | ||
| |-------------|-----------|-----------------|------------| | ||
| | ... | ... | ... | ... | | ||
|
|
||
| ### Caller Impact | ||
| | Caller File | Caller Method | Change Required | | ||
| |-------------|---------------|-----------------| | ||
| | ... | ... | ... | | ||
|
|
||
| ### TDD Contract Tests Required | ||
| | Test # | Scenario | Expected Result | | ||
| |--------|-----------------|-----------------| | ||
| | 1 | Happy path | ... | | ||
| | 2 | Null/guard edge | ... | | ||
| | 3 | Caller invariant| ... | | ||
| ``` | ||
|
|
||
| **Output**: Write `docs/brain/implementation_plan_t[ID].md` | ||
|
|
||
| ### !!! DIRECTOR APPROVAL GATE !!! | ||
| **STOP HERE. Do NOT proceed to Step 3 until the Director explicitly confirms.** | ||
|
|
||
| Output: "[BOB-TDD-GATE] Plan written to docs/brain/implementation_plan_t[ID].md. Awaiting Director approval." | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 3 -- P4 ADJUDICATOR AUDIT (Internal) | ||
|
|
||
| Perform adversarial self-audit of the plan against V12 DNA: | ||
|
|
||
| Checklist: | ||
| - [ ] Zero lock() usage in proposed code | ||
| - [ ] No Thread.Sleep in proposed tests | ||
| - [ ] Extraction is >= 15 LOC (extraction floor) | ||
| - [ ] No logic drift -- pure structural extraction | ||
| - [ ] ASCII-only in all string literals | ||
| - [ ] deploy-sync.ps1 is included in post-edit sequence | ||
|
|
||
| **Output**: Write `docs/brain/adjudicator_audit_t[ID].md` | ||
|
|
||
| If any checklist item FAILS: return `CONDITIONAL PASS` with specific clarification. | ||
| If all pass: return `PASS -- CLEARED FOR P5 EXECUTION`. | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 4 -- P5 ENGINEER (Advanced/Code Mode) -- RED-GREEN | ||
|
|
||
| ### RED Phase: Write Failing Contract Tests FIRST | ||
|
|
||
| Before touching src/, write the contract tests to `tests/[SubgraphName]IntegrationTests.cs`: | ||
|
|
||
| Required scenarios: | ||
| 1. **Happy path**: normal input -> expected extracted-helper output | ||
| 2. **Null/guard edge**: boundary condition -> must not throw or corrupt state | ||
| 3. **Caller invariant**: call site behavior is identical before and after extraction | ||
|
|
||
| The tests MUST fail at this point (RED). Do NOT proceed if they pass -- that means | ||
| the test is not actually targeting the new helper. | ||
|
|
||
| ### GREEN Phase: Extract the Method | ||
|
|
||
| Apply surgical extraction: | ||
| - Use `v12_split.py` for any extraction exceeding 50 lines (manual copy-paste BANNED) | ||
| - Touch ONLY the target method and its new helper | ||
| - NEVER mutate whitespace, indentation, or adjacent unrelated code | ||
| - After extraction, run the contract tests -- they must now PASS (GREEN) | ||
|
|
||
| **Self-healing retry**: If GREEN fails, re-examine extraction boundary and retry up to 3 times. | ||
| If 3 attempts fail: HALT. Report exact failure trace. Do NOT proceed. | ||
|
|
||
| ### Post-Edit Deployment (MANDATORY) | ||
| ```powershell | ||
| # Re-establish hard links + ASCII gate | ||
| powershell -File .\deploy-sync.ps1 | ||
|
|
||
| # Lock regression audit (must return ZERO matches) | ||
| grep -r "lock(" src/ | ||
|
|
||
| # Unicode regression audit (must return ZERO matches) | ||
| grep -Prn "[^\x00-\x7F]" src/ | ||
| ``` | ||
|
|
||
| All three must PASS before proceeding to P6. | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 5 -- P6 VERIFIER (Plan/Code Mode) -- REFACTOR | ||
|
|
||
| Run full verification suite: | ||
|
|
||
| ```powershell | ||
| # Full test suite | ||
| dotnet test tests/ | ||
|
|
||
| # Complexity audit -- confirm CYC delta meets ticket target | ||
| python scripts/complexity_audit.py | ||
|
|
||
| # Final hard-link sync | ||
| powershell -File .\deploy-sync.ps1 | ||
| ``` | ||
|
|
||
| **Output**: Write `docs/brain/verification_report_t[ID].md` containing: | ||
| - Test pass rate (e.g., `20/20 PASS`) | ||
| - CYC before/after delta | ||
| - Lock audit: CLEAN | ||
| - Unicode audit: CLEAN | ||
| - deploy-sync.ps1: PASS | ||
| - BUILD_TAG (bump now) | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 6 -- HANDOFF TO DIRECTOR | ||
|
|
||
| Only after ALL Step 5 audits PASS, output: | ||
|
|
||
| ``` | ||
| [BOB-TDD-COMPLETE] | ||
| Ticket: [ID] | ||
| Method: [target method] | ||
| CYC: [before] -> [after] | ||
| Tests: [N]/[N] PASS | ||
| BUILD_TAG: [new tag] | ||
| Status: READY FOR F5 COMPILE | ||
|
|
||
| Director Post-Ticket Checklist: | ||
| [ ] Press F5 in NinjaTrader -- verify BUILD_TAG banner | ||
| [ ] Confirm complexity_audit.py pass in verification report | ||
| [ ] Confirm test pass rate in verification report | ||
| [ ] Commit forensics + plan + verification reports | ||
| [ ] Update BUILD_TAG_BASELINE in next ticket's header prompt | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## BANNED PATTERNS (immediate halt) | ||
|
|
||
| - `lock(anything)` -- BANNED | ||
| - `Monitor.Enter` / `Monitor.Exit` -- BANNED | ||
| - `Thread.Sleep()` anywhere -- BANNED | ||
| - Unicode / emoji / curly quotes in any string literal -- BANNED | ||
| - Manual copy-paste for extractions > 50 lines -- BANNED (use v12_split.py) | ||
| - Skipping RED phase (writing GREEN without a failing test first) -- BANNED | ||
| - Proceeding past any GATE without explicit Director confirmation -- BANNED | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| --- | ||
| description: Consolidate 7 cluster bug reports into a validated, hallucination-filtered, ranked repair plan. Run after all 7 cluster-bug-hunt reports are complete. | ||
| argument-hint: runner (optional -- runner suffix, e.g. bob, qwen, jules, gemini. Defaults to bob) | ||
| --- | ||
| # MISSION: Bug Bounty Consolidation -- V12 Photon Kernel | ||
| **Spec Ref**: docs/brain/bug_bounty_workflow.md | ||
| **Input**: docs/brain/bug_report_s1_[runner].md through bug_report_s7_[runner].md (all 7 must exist) | ||
| **Output**: docs/brain/cluster_bug_bounty_report_[runner].md | ||
|
Comment on lines
+7
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix runner filename contract mismatch in ingestion step. The declared input format uses Suggested fix- Read the following files in order:
- - docs/brain/bug_report_s1.md (S1: SIMA Core)
- - docs/brain/bug_report_s2.md (S2: Execution Engine)
- - docs/brain/bug_report_s3.md (S3: UI & Photon IO)
- - docs/brain/bug_report_s4.md (S4: REAPER Defense)
- - docs/brain/bug_report_s5.md (S5: Kernel State)
- - docs/brain/bug_report_s6.md (S6: Signals & Entries)
- - docs/brain/bug_report_s7.md (S7: Kernel Infrastructure)
+ Read the following files in order:
+ - docs/brain/bug_report_s1_[runner].md (S1: SIMA Core)
+ - docs/brain/bug_report_s2_[runner].md (S2: Execution Engine)
+ - docs/brain/bug_report_s3_[runner].md (S3: UI & Photon IO)
+ - docs/brain/bug_report_s4_[runner].md (S4: REAPER Defense)
+ - docs/brain/bug_report_s5_[runner].md (S5: Kernel State)
+ - docs/brain/bug_report_s6_[runner].md (S6: Signals & Entries)
+ - docs/brain/bug_report_s7_[runner].md (S7: Kernel Infrastructure)Also applies to: 16-22 🤖 Prompt for AI Agents |
||
| **Mode**: Plan mode -- READ ONLY. No src/ edits. | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 1 -- INGEST ALL 7 REPORTS | ||
|
|
||
| Read the following files in order: | ||
| - docs/brain/bug_report_s1.md (S1: SIMA Core) | ||
| - docs/brain/bug_report_s2.md (S2: Execution Engine) | ||
| - docs/brain/bug_report_s3.md (S3: UI & Photon IO) | ||
| - docs/brain/bug_report_s4.md (S4: REAPER Defense) | ||
| - docs/brain/bug_report_s5.md (S5: Kernel State) | ||
| - docs/brain/bug_report_s6.md (S6: Signals & Entries) | ||
| - docs/brain/bug_report_s7.md (S7: Kernel Infrastructure) | ||
|
|
||
| If any file is missing: HALT and report to Director which clusters are incomplete. | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 2 -- HALLUCINATION FILTER | ||
|
|
||
| For EVERY reported bug across all 7 reports: | ||
| 1. Use jCodemunch `search_symbols` to verify the cited method exists | ||
| 2. Use `get_file_content` to verify the cited code pattern matches actual src/ | ||
| 3. Use `find_references` to confirm the cited shared state is actually accessed | ||
|
|
||
| Disposition for each bug: | ||
| - VALIDATED: evidence confirmed in src/ | ||
| - FILTERED: cited method/pattern does not match src/ reality | ||
| - UNCERTAIN: partially verifiable -- flag for Director review | ||
|
|
||
| Track and report the filter rate per cluster. | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 3 -- CROSS-CLUSTER DEDUPLICATION | ||
|
|
||
| Identify bugs reported by multiple agents for the same root cause: | ||
| - Match on: same file + same method + same root cause mechanism | ||
| - Merge into single canonical entry | ||
| - List all clusters that reported it | ||
| - Elevate severity if blast radius spans 2+ clusters | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 4 -- SEVERITY RANKING | ||
|
|
||
| Final ranking of all validated bugs: | ||
| - Critical: Data corruption, race conditions, use-after-free | ||
| - High: FSM state leaks, ghost order windows, O(N^2) hot paths, semaphore leaks | ||
| - Med: Missing null guards, incomplete resets, inefficient lookups | ||
| - Low: Style violations, minor inefficiencies | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 5 -- OUTPUT | ||
|
|
||
| Write docs/brain/cluster_bug_bounty_report_[runner].md containing: | ||
|
|
||
| ``` | ||
| # V12 Cluster Bug Bounty Report | ||
| Generated: [date] | ||
|
|
||
| ## Summary | ||
| Total bugs found (raw): [N] | ||
| Validated: [N] | Filtered (hallucinations): [N] | Uncertain (Director review): [N] | ||
| Critical: [N] | High: [N] | Med: [N] | Low: [N] | ||
|
|
||
| ## Filter Rate by Cluster | ||
| | Cluster | Found | Validated | Filtered | | ||
| |---------|-------|-----------|----------| | ||
| | S1 SIMA | N | N | N | | ||
| ... | ||
|
|
||
| ## Validated Bug List (ranked by severity) | ||
| [full list in BUG-[S#]-[NNN] format] | ||
|
|
||
| ## Recommended Repair Sequence | ||
| [cluster order based on Critical count and dependency graph] | ||
|
|
||
| ## /epic-tdd Ticket Blocks | ||
| [copy-paste ready ticket for each validated bug] | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## STEP 6 -- HANDOFF | ||
|
|
||
| Output: | ||
| ``` | ||
| [BUG-BOUNTY-CONSOLIDATION-COMPLETE] | ||
| Total validated: [N] | ||
| Filtered: [N] | ||
| Uncertain (needs Director review): [N] | ||
| Report: docs/brain/cluster_bug_bounty_report_[runner].md | ||
| Next: Director reviews report -> selects cluster -> /epic-tdd for repairs | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## BANNED | ||
| - Any src/ edit -- BANNED | ||
| - Fixing bugs inline -- BANNED | ||
| - Marking a bug VALIDATED without jCodemunch verification -- BANNED | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add explicit language tags for these fenced blocks.
Both blocks are missing a fence language and trigger markdownlint MD040.
Also applies to: 158-173
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 40-40: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents