Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: align Nelson with Claude Code dynamic workflows (v1)#126

Merged
harrymunro merged 2 commits into
mainfrom
feat/dynamic-workflow-alignment
Jul 3, 2026
Merged

feat: align Nelson with Claude Code dynamic workflows (v1)#126
harrymunro merged 2 commits into
mainfrom
feat/dynamic-workflow-alignment

Conversation

@harrymunro

Copy link
Copy Markdown
Collaborator

Summary

Implements a v1 alignment layer so Nelson understands Claude Code dynamic workflows without trying to replace them. Nelson gains two first-class execution modes, supporting doctrine, battle-plan charter fields, structured-data schema additions, and tests.

Nelson v1 documents and preserves workflow charters; it does not generate or invoke .claude/workflows/*.js.

Execution modes

Mode Purpose
workflow One approved autonomous dynamic-workflow run for large fan-out, repeatable review/migration, audits, or cross-checked research.
hybrid-workflow Nelson-gated sequence of separate workflow stages with explicit human approval between runs (default for Station 2/3 work).

single-session, subagents, and agent-team are unchanged. ultracode is documented as a Claude Code xhigh effort/automation setting, not a Nelson mode.

Changes

Code

  • VALID_MODES += workflow, hybrid-workflow; CLI --mode help updated across squadron / form / headless.
  • New mission-log event types: workflow_charter_created, workflow_probe_completed, workflow_run_started, workflow_run_completed, workflow_run_stopped.
  • squadron / form persist the mode and optional workflow charter / advisory fields into battle-plan.json; execution_mode recorded in fleet-status.json. form mode precedence: plan.modesquadron.mode → CLI --mode. Validation for the optional workflow object shape.

Docs / doctrine

  • New references/workflow-doctrine.md (suitability, ultracode readiness, "Sounding the Channel" probes, verification contracts, cost controls, telemetry, damage-control mapping).
  • Updated SKILL.md (Steps 3–7), README.md (three → five modes + "Dynamic workflows and ultracode"), squadron-composition.md, tool-mapping.md, structured-data.md, and admiralty templates (battle-plan.md, crew-briefing.md), plus docs/project_structure.md.

Tests

  • Mode persistence (workflow / hybrid-workflow) and invalid-mode rejection.
  • Optional workflow schema acceptance + preservation in battle-plan.json; existing plan JSON stays valid.
  • New workflow event acceptance + unknown-event rejection; headless mode preservation.
  • Docs/reference assertions for both modes and doctrine; hook test confirming workflow modes are not captain-gated.

Verification

  • ruff check ✓ · ruff format --check
  • pytest skills/nelson/scripts/ → 396 passed
  • pytest hooks/ → 65 passed · pytest scripts/ → 21 passed
  • pre-commit run --all-files ✓ · scripts/check-references.sh

Add 'workflow' and 'hybrid-workflow' execution modes plus supporting doctrine, battle-plan charter fields, structured-data schema, and tests. Nelson v1 documents and preserves workflow charters but does not generate or invoke .claude/workflows/*.js.

- Add workflow + hybrid-workflow to VALID_MODES and CLI help

- Add workflow mission-log event types (charter/probe/run started/completed/stopped)

- Persist mode + optional workflow charter/advisory fields in battle-plan.json and fleet-status.json

- Add references/workflow-doctrine.md; update SKILL.md, README, squadron-composition, tool-mapping, structured-data, and admiralty templates

- Add data-validation, schema-preservation, event, hook, and docs tests
…mics

Nelson now integrates the /goal feature (session-scoped Stop hooks) and
gives the workflow charter a runnable path, so power users can drive both
Claude Code features from the framework.

Goal alignment (new):
- Add references/goal-alignment.md — "standing goal" doctrine. Central
  fact: the /goal evaluator judges only the conversation transcript, so
  completion evidence (metric, captain's log path, stand-down) must be
  surfaced into chat; conditions phrased against on-disk artifacts loop
  forever.
- Add nelson-data.py goal-condition: composes a transcript-verifiable
  /goal string from sailing-orders.json (outcome + metric + stop
  criteria + a scuttle-and-reform escape), with --max-turns, --record
  (persists goal_condition + logs goal_set), and --json. 4,000-char limit
  enforced.
- Wire the standing goal into SKILL.md Step 1 (offer/reconcile), Step 8
  (surface evidence so the goal auto-clears), and session resumption
  (re-establish on a fresh session).
- Add goal_set / goal_cleared event types; optional goal_condition field
  in sailing-orders.json, preserved through later writes.

Workflow ergonomics:
- workflow-doctrine.md gains a charter-to-runnable-script bridge (charter
  fields map onto meta/phase/pipeline/parallel + adversarial verify) and
  a standing-goal-and-workflows section; note saved workflows live in
  .claude/workflows/*.js and run as /<name>.

Docs + tests:
- tool-mapping.md: /goal rows, Standing Goal Notes, two anti-patterns.
- structured-data.md, README, project_structure updated.
- New test_nelson_data_goal.py (19 tests): composer purity/immutability,
  CLI output/JSON/record/limit, event validity, schema preservation.

All sensors green: ruff, ruff format, pytest (415/65/21), pre-commit,
markdownlint, typos, check-references.

Closes nelson-cni.
@harrymunro harrymunro merged commit 0b78726 into main Jul 3, 2026
11 checks passed
@harrymunro harrymunro deleted the feat/dynamic-workflow-alignment branch July 3, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant