Commit Graph

334 Commits

Author SHA1 Message Date
Lucas Berger 339b366bcc docs(11-01): complete bitmap encoding plan -- unlimited container selection
- Created 11-01-SUMMARY.md with technical details and verification results
- Updated STATE.md: Phase 11 plan 1/2 complete, 50% progress
- Key metrics: 5m 16s duration, 2 tasks, 4 nodes added (1 batch-ui + 3 main workflow)
- Node counts: n8n-batch-ui.json 17 nodes, n8n-workflow.json 171 nodes
- Decisions: base36 BigInt encoding, graceful migration via dual parsers
2026-02-08 18:56:44 -05:00
Lucas Berger bac38634a3 feat(11-01): update main workflow for bitmap-encoded batch callbacks
- Add new parsers for b: (toggle), bn: (nav), be: (exec) formats in Parse Callback Data
- Update Prepare Batch UI Input to forward bitmap field instead of selectedCsv
- Retain old batch:toggle/nav/exec parsers for backward compatibility with in-flight messages
- Add bitmap detection in bstop:confirm parser (detects alphanumeric vs CSV format)
- Add 3 new nodes for bitmap resolution flow:
  - Is Bitmap Batch Stop (IF node)
  - Fetch Containers For Bitmap Stop (HTTP)
  - Resolve Batch Stop Names (Code node with decodeBitmap)
- Wire bitmap resolution flow: Check Batch Stop Expired -> Is Bitmap -> [true] Fetch -> Resolve -> Initialize
- Legacy CSV format routes directly to Initialize Batch State (false path)
- Total: 171 nodes (168 + 3 new)
2026-02-08 18:56:44 -05:00
Lucas Berger cea467f493 feat(11-01): implement bitmap encoding in batch UI sub-workflow
- Replace CSV-in-callback with base36 bitmap encoding
- Add Fetch Containers For Exec node for bitmap->name resolution
- Update all code nodes to use BigInt bitmap operations
- New callback formats: b:{page}:{bitmap}:{index}, bn:{bitmap}:{page}, be:{action}:{bitmap}
- Remove 64-byte limit check (bitmap encoding ~20 bytes max for 50 containers)
- Update trigger schema: selectedCsv -> bitmap, add containerIndex field
- Total: 17 nodes (16 original + 1 new)
2026-02-08 18:56:44 -05:00
Lucas Berger 1245aeed4f docs(11): create phase plan — bitmap batch selection + update all button 2026-02-08 18:56:44 -05:00
Lucas Berger 23ba84ae4e docs(11): research phase domain 2026-02-08 18:56:44 -05:00
Lucas Berger d2c44c0254 docs(phase-10.2): complete phase verification — all gaps closed 2026-02-08 18:56:44 -05:00
Lucas Berger dd30a899aa docs: add CLAUDE.md project instructions and debug analysis
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger f86ed83d00 docs(10.2-04): update UAT status - gaps 1-3 closed, gap 4 accepted
- Updated UAT status to gap-closure-complete
- Marked gaps 1-3 as closed by 10.2-04-PLAN.md
- Marked gap 4 as accepted (minor, no scope creep)
2026-02-08 18:56:44 -05:00
Lucas Berger 642162e0d3 docs(10.2-04): complete gap closure plan
- Created 10.2-04-SUMMARY.md with execution details
- Updated STATE.md: 4/4 plans complete, correlation IDs wired
- Documented UAT gaps 1-3 closed (gap 4 accepted as minor)
- Final state: 168 nodes, correlation IDs functional
2026-02-08 18:56:44 -05:00
Lucas Berger 43f525a89c fix(10.2-04): wire correlation ID generators and remove orphan nodes
- Renamed connection keys from node IDs to node names (Generate Correlation ID, Generate Callback Correlation ID)
- Rewired IF User Authenticated -> Generate Correlation ID -> Keyword Router
- Rewired IF Callback Authenticated -> Generate Callback Correlation ID -> Parse Callback Data
- Removed 2 orphan nodes (Delete Batch Confirm Message, Send Text Update Started)
- Removed ghost connection key (code-log-error)
- Node count reduced from 170 to 168
2026-02-08 18:56:44 -05:00
Lucas Berger 5434ef20d1 docs(10.2): create gap closure plan for correlation ID wiring 2026-02-08 18:56:44 -05:00
Lucas Berger c288fa1d39 test(10.2): complete UAT - 2 passed, 4 issues 2026-02-08 18:56:44 -05:00
Lucas Berger 03af26598f docs(phase-10.2): complete phase execution 2026-02-08 18:56:44 -05:00
Lucas Berger f620229cec docs(10.2-03): complete plan — scope reduction due to n8n static data limitation
- Created 10.2-03-SUMMARY.md documenting scope reduction and platform limitation
- Updated STATE.md: Phase 10.2 complete (3/3 plans)
- Documented critical finding: n8n static data does not persist between executions
- Final state: 170 nodes (168 baseline + 2 correlation ID generators)
- Correlation ID infrastructure and structured error returns retained
2026-02-08 18:56:44 -05:00
Lucas Berger 7f579d5fe9 refactor(10.2): remove static-data-dependent debug commands and logging nodes
n8n workflow static data does not persist between executions on this
instance, making the ring buffer, debug commands, and trace capture
non-functional. Removed:
- 4 Keyword Router debug rules (/errors, /clear, /debug, /trace)
- Process Debug Command + Send Debug Response nodes
- Log Error + Log Trace utility nodes
- 2 error detection IF nodes (Check Execute *Action Success)
- Inline trace blocks from 7 result-handling Code nodes

Kept: structured error returns in sub-workflows (success/false + error
objects), correlation ID generation, correlationId pass-through.

Node count: 176 -> 170.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger 10ad20f495 fix(10.2-03): use JSON-serialized top-level key for n8n static data persistence
n8n $getWorkflowStaticData only reliably tracks top-level property changes.
Deep nested mutations (staticData.errorLog.debug.enabled = true) are not
persisted between executions. Fix: serialize errorLog as JSON string in
staticData._errorLog — every read does JSON.parse, every write does
JSON.stringify as a top-level assignment.

Fixed in: Process Debug Command, Log Error, Log Trace, 6 inline trace
nodes, Parse Callback Data callback routing trace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger e331d1618e fix(10.2-03): fix correlationId placement in 19 Prepare Input nodes
Plan 02 executor placed correlationId outside the json object in all
Prepare Input code nodes, creating "Unexpected token '}'" syntax errors.
Moved correlationId inside the json return object in all 19 affected nodes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger 69eb4e0b9d fix(10.2-03): reorder Keyword Router rules — debug commands before generic contains
Two bugs: (1) connection array had old fallback at index [9] shifting debug
connections off-by-one, so /errors routed to Show Menu. (2) /debug status
matched rule 1 (contains "status") before rule 11 (startsWith /debug).
Fix: move startsWith debug rules [1-4] before contains rules [5-12].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger e7074288f0 feat(10.2-03): wire debug trace capture at sub-workflow boundaries and callback routing
- Added debug trace capture to 6 result-handling Code nodes
- Traces capture sub-workflow boundary data (success, action, hasError)
- Added callback routing trace to Parse Callback Data node
- Traces only activate when debug mode enabled (staticData.errorLog.debug.enabled)
- Auto-disable after 100 executions to prevent performance impact
- Inline tracing (no new nodes added, node count remains 176)
2026-02-08 18:56:44 -05:00
Lucas Berger 2ac0ba78bd docs(10.2-02): complete plan -- error propagation and correlation IDs
Summary:
- All 7 sub-workflows now return structured error objects
- Main workflow generates correlation IDs for request tracing
- Error detection active for 2 high-value paths
- 8 workflow JSON files modified (1 main + 7 sub-workflows)
- Main workflow: 172 -> 176 nodes (+4)
- Duration: 5.5 minutes
- Deviations: 2 (error detection scope reduced, logs trigger workaround)

STATE.md updates:
- Plan 2 of 3 complete (67% progress)
- Added achievements for 10.2-02
- Added 3 new decisions
- Updated next step to Plan 03
2026-02-08 18:56:44 -05:00
Lucas Berger f7130f61fc feat(10.2-02): add correlation ID generation and error capture to main workflow
Part A - Correlation ID Generation:
- Added Generate Correlation ID node for text command path
- Added Generate Callback Correlation ID node for callback path
- Wired between authentication and routing nodes
- Uses timestamp + random string pattern (no external dependencies)

Part B - Correlation ID Propagation:
- Modified 19 Prepare Input nodes to pass correlationId to sub-workflows
- Uses $input.item.json.correlationId pattern for flexibility
- Supports both text and callback paths

Part C - Error Capture Infrastructure:
- Added 2 error detection IF nodes for high-value paths:
  * Check Execute Container Action Success
  * Check Execute Inline Action Success
- Error path: success === false → Log Error node
- Success path: continues to original result handling
- Log Error node receives error data from sub-workflows
- Pass-through design preserves data for downstream handlers

Main workflow: 172 → 176 nodes (+4)
- 2 correlation ID generators
- 2 error detection IF nodes

Error ring buffer now captures:
- Container action failures (Docker API errors)
- Sub-workflow errors with full diagnostic context
- Correlation IDs for request tracing
- Workflow name, node, HTTP codes, raw responses
2026-02-08 18:56:44 -05:00
Lucas Berger 1c632d039a feat(10.2-02): add structured error returns to all 7 sub-workflows
- Added correlationId field to all sub-workflow trigger schemas
- Added success: true/false fields to return paths
- Added error objects to failure paths with workflow, node, message, httpCode, rawResponse
- Implemented correlationId pass-through for error correlation
- Preserved backward compatibility (existing return fields unchanged)

Modified sub-workflows:
- n8n-actions.json: 3 Format Result nodes with full error objects
- n8n-update.json: Pull/Create/Start error paths with error objects
- n8n-logs.json: Added correlationId pass-through
- n8n-batch-ui.json: Added correlationId to trigger
- n8n-status.json: Added correlationId to trigger
- n8n-confirmation.json: Added correlationId pass-through to stop action
- n8n-matching.json: Added correlationId to trigger

All sub-workflows now return structured error objects on failures for main workflow error ring buffer capture.
2026-02-08 18:56:44 -05:00
Lucas Berger 6833641ad1 docs(10.2-01): complete error ring buffer foundation plan
- Create 10.2-01-SUMMARY.md with full plan execution details
- Update STATE.md: Phase 10.2 plan 1 of 3 complete (33% progress)
- Document all technical decisions and architecture patterns
- Self-check verification passed: all files and commits present
- Duration: 156 seconds (2.6 minutes)
- Node count: 168 -> 172 (+4 nodes: 2 command, 2 utility)
- Ring buffer infrastructure ready for Plan 02 wiring
2026-02-08 18:56:44 -05:00
Lucas Berger 030118efb3 feat(10.2-01): add error and trace logging utility nodes
- Create Log Error code node with ring buffer write logic
- Create Log Trace code node with debug mode check and auto-disable
- Both nodes implement ring buffer (max 50 entries) with auto-rotation
- Log Error: accepts error data, truncates large fields (stack 500, raw 1000)
- Log Error: passes through input data with _errorLogged flag
- Log Trace: checks debug.enabled before logging, passes through unchanged
- Log Trace: auto-disables debug mode after 100 executions
- Both nodes positioned at utility area (2600, -200/-400)
- Nodes are standalone (no connections) - ready for Plan 02 wiring
- Node count: 170 -> 172 (+2 utility nodes)
2026-02-08 18:56:44 -05:00
Lucas Berger d1d13ca671 feat(10.2-01): add hidden debug commands and error ring buffer foundation
- Add 4 new keyword routes: /errors, /clear-errors, /debug, /trace
- Create Process Debug Command code node with unified command handling
- Initialize workflow static data structure (errorLog with debug, errors, traces)
- Implement /errors command to display recent errors (default 5, max 50)
- Implement /clear-errors command to reset error buffer
- Implement /debug on|off|status for debug mode toggle
- Implement /trace <correlationId> for correlation-based query
- Add Send Debug Response Telegram node with HTML formatting
- Wire Keyword Router -> Process Debug Command -> Send Debug Response
- Commands remain hidden (not listed in /start menu)
- Node count: 168 -> 170 (+2 nodes)
2026-02-08 18:56:44 -05:00
Lucas Berger c79a3fbf87 docs(10.2): plan phase — error ring buffer, sub-workflow error propagation, debug tracing
3 plans in 3 waves:
- Wave 1: Ring buffer foundation + hidden debug commands (/errors, /debug, /trace, /clear-errors)
- Wave 2: Structured error returns in all 7 sub-workflows + correlation ID tracking
- Wave 3: Debug mode tracing at sub-workflow boundaries + deployment verification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger e9a84794b9 docs(10.2): create phase plan 2026-02-08 18:56:44 -05:00
Lucas Berger 0ef36ab4c8 docs(10.2): research phase domain 2026-02-08 18:56:44 -05:00
Lucas Berger df637c9286 docs(10.2): capture phase context 2026-02-08 18:56:44 -05:00
Lucas Berger ac2d745e1d fix(10.1-09): wire /list command connection to Prepare Status Input
The list keyword rule was added to Keyword Router but its connection
pointed to Show Menu (fallback) instead of Prepare Status Input.
Added proper connection at index 8 and shifted fallback to index 9.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger 8db937683e docs(phase-10.1): complete phase execution 2026-02-08 18:56:44 -05:00
Lucas Berger 0b6b12ee7e docs(10.1-09): complete UAT gap closure plan 2026-02-08 18:56:44 -05:00
Lucas Berger e67800c4f6 chore(10.1-09): deploy updated workflow to n8n
- Successfully deployed n8n-workflow.json to n8n instance
- Workflow ID: HmiXBlJefBRPMS0m4iNYc
- All three UAT gap fixes now live
2026-02-08 18:56:44 -05:00
Lucas Berger f4fd5d5256 docs(10.1-08): complete container action status code handling plan 2026-02-08 18:56:44 -05:00
Lucas Berger a5cffc3745 feat(10.1-09): add /list command to Keyword Router
- Added 'list' route with same output as 'status'
- Both /list and /status now show paginated container list
- Provides user-expected /list command while leveraging existing functionality
2026-02-08 18:56:44 -05:00
Lucas Berger 0ba573a24d feat(10.1-08): add statusCode handling to container action result formatters
- Add HTTP 304 detection for 'already in desired state' (success: true)
- Add HTTP 404 detection for 'container not found' (success: false)
- Add HTTP 500+ detection for server errors (success: false)
- Apply to Format Stop/Start/Restart Result nodes
- StatusCode checks run before existing message-based fallback logic
2026-02-08 18:56:44 -05:00
Lucas Berger 9982a59adc fix(10.1-09): use dynamic input in Build Cancel Return Submenu
- Changed $('Prepare Cancel Return').item.json to $input.item.json
- Allows node to work with both cancel paths (batch cancel and confirmation cancel)
- Fixes confirmation dialog cancel button returning to container status view
2026-02-08 18:56:44 -05:00
Lucas Berger 95f29e5433 fix(10.1-09): use actionType field in Build Batch Keyboard
- Changed const action = $json.action to $json.actionType
- Fixes disambiguation keyboard showing 'multiple all?' instead of actual action
- Ensures correct callback_data format: bexec:{action}:... not bexec:multiple:...
2026-02-08 18:56:44 -05:00
Lucas Berger f3ab7cf312 docs(10.1): create UAT gap closure plans (08-09) 2026-02-08 18:56:44 -05:00
Lucas Berger b74fb3c19c test(10.1): diagnose 4 UAT issues with root causes
- Gap 1: Format Stop/Start/Restart missing statusCode 304 check
- Gap 2: Build Batch Keyboard reads action instead of actionType
- Gap 3: /list not implemented in Keyword Router (minor)
- Gap 4: Build Cancel Return Submenu references wrong predecessor

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger 14589f3cb6 test(10.1): complete UAT - 11 passed, 4 issues
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger 22bbe4b6ba docs(10.1): mark Phase 10.1 complete in roadmap (7/7 plans)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger 2a4505d2d4 docs(10.1-07): complete Code classification and contract documentation plan
- 10.1-07-SUMMARY.md: Plan execution results with self-check passed
- STATE.md: Phase 10.1 marked COMPLETE (7/7 plans), decisions updated

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger 178bc544dc docs(10.1-07): document sub-workflow contracts and node count analysis
- Add detailed I/O contracts for all 7 sub-workflows with field-level docs
- Verify all 17 Execute Workflow nodes receive correct input fields
- Add node count analysis proving 168 nodes is 2 above structural minimum
- Show diminishing returns evidence (extraction efficiency: 81% -> 0% -> -50%)
- Close verification gaps 2 and 3 with documented evidence

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger f0aae416aa docs(10.1-07): classify all 60 Code nodes in main workflow
- Add Code Node Classification section to DEPLOY-SUBWORKFLOWS.md
- Classify each Code node into 6 categories with evidence
- 58 nodes confirmed as orchestration infrastructure (must stay)
- 2 domain-logic candidates identified but extraction is net-negative
- Summary proves no further extraction is viable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger 4eeed1d9e1 docs(10.1-06): complete matching extraction plan 2026-02-08 18:56:44 -05:00
Lucas Berger 6824697295 fix(10.1-06): fix batch text command data flow through matching sub-workflow
Added "Prepare Batch Execution" Code node between Route Batch Match Result
and Route Batch Action to transform matching sub-workflow output:
- matchedContainers -> allMatched (field name expected by downstream nodes)
- action from Detect Batch Command (stop/start/restart) instead of
  "batch_matched" routing label from sub-workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger aae95e2405 fix(10.1-06): strip inline keyboard from text-mode status responses
Text commands like "status book" should show plain text status without
inline keyboard buttons. Added "Strip Status Keyboard" Code node that
removes reply_markup before sending via Send Container Submenu Direct.
Callback-based status (with messageId) still gets the full UI with buttons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger 138728a7b1 fix(10.1-06): fix action type passthrough and text status routing
- Prepare Text Action Input now reads action (stop/start/restart) from
  Parse Action Command instead of matching sub-workflow's actionType field
- Added "Has Status Message ID" If node to route status_direct results:
  messageId > 0 → Edit Container List (callback), messageId == 0 →
  Send Container Submenu Direct (text command)
- Pre-existing bug: text "status <name>" routed to editMessageText with
  messageId 0, causing Telegram API error

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00
Lucas Berger 596b0e5dab fix(10.1-06): replace matching workflow placeholders with deployed ID kL4BoI8ITSP9Oxek
- Updated 3 Execute Workflow nodes: Execute Action Match, Execute Update Match, Execute Batch Match
- Deployed n8n-matching.json as workflow kL4BoI8ITSP9Oxek
- Pushed main workflow to n8n API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:56:44 -05:00