Skip to content

feat(mcode-island): add sub-step progress fields to status.json (v0.4.0) - #3

Closed
antianqi wants to merge 1 commit into
mainfrom
feat/substep-progress
Closed

antianqi wants to merge 1 commit into
mainfrom
feat/substep-progress

Conversation

@antianqi

Copy link
Copy Markdown
Owner

Extends status.json schema with three optional fields — step, total,
detail — so agents can publish per-iteration progress during Computer
Use loops, multi-step plans, and long-running tool sequences. The widget
now renders "step N[/M] · detail" instead of only the coarse state, so
the user can see what the agent is doing right now without waiting for
it to finish.

Surface changes

notify-island.ps1
New params: -Step , -Total , -Detail
All default to -1 / -1 / "" for full backward compatibility.
The status.json payload now writes step/total/detail alongside the
existing state/message/progress fields. Old callers (omitting the
new params) produce identical status.json behavior except for three
extra fields whose values are the sentinels.

mcode-island.ps1 (widget)
New Build-DisplayMessage helper that converts the schema fields into
the visible pill text. Render branches:
step > 0 + total > 0 -> "step N/M · "
step > 0 + total <= 0 -> "step N · "
step > 0 + detail == "" -> "step N[/M]" (avoid message stacking)
step <= 0 -> original message (legacy path)
The poll-handler signature and init block were extended with the same
three fields and the change-detection string now includes them, so
consecutive working+message pushes with different step values are
not collapsed by the 400 ms dedupe.

io.minimax.mcode/hooks/scripts/_lib.ps1
Push-Island now accepts -Step/-Total/-Detail and forwards them to
notify-island.ps1. Format-ToolSummary has a new mcode-computer-use
branch that extracts action + coordinate with explicit -join ","
so coordinate arrays render as "(x,y)" not PowerShell's default
"(x y)" (the latter looked like a truncated number on the pill).

io.minimax.mcode/hooks/scripts/post-tool-use.ps1
Pushes -Detail with the Format-ToolSummary output split so the pill
shows "Bash ok · ls -la /tmp" instead of "Bash ok". pre-tool-use.ps1
already used Format-ToolSummary so no change there.

Backward compatibility

All new schema fields are optional. notify-island.ps1 callers that
omit -Step/-Total/-Detail see no behavior change. Widget versions that
do not know the new fields ignore them (PSObject.Properties[name]
everywhere). Verified by smoke.mjs case "backward compat: old callers
produce step=-1, total=-1, detail=""" and test-substep-progress.mjs
case "Push-Island backward compat: missing new params -> step=-1,
total=-1, detail=""".

Design compliance (per PR MiniMax-AI#21 round-11 standards)

no credentials : none added; the IPC is local-filesystem only
no network : no network calls added; notify-island.ps1 still
writes status.json under %APPDATA%/mcode-island
no telemetry : no telemetry added; the existing append-only
island.log is unchanged and the 400 ms polling
cadence is unchanged
no third-party svcs : no new third-party deps; the change is pure
PowerShell + schema
cross-platform : no hardcoded host paths; no /Users/ /home/
C:\ /mnt/ literals introduced; the existing
smoke.mjs cross-platform scan still passes
atomic write : notify-island.ps1 already writes status.json
atomically via staging + rename; no change
closed schema : status.json is open by design (not contract-
locked), but each new field has a documented
sentinel (-1 / -1 / "") so absent fields are
semantically equivalent to explicit sentinels
smoke self-check : smoke.mjs gained 5 new checks under section
5c1; locked the new surface contract so a
future refactor that drops the params surfaces
in smoke before reaching the slower pwsh-spawned
tests

Validation

smoke.mjs : 48 pass, 7 warn, 0 fail
(7 warn are pre-existing "forward" event catalog entries pending
mcode 0.2.4+ Runtime confirmation; unchanged by this PR)

scripts/test-substep-progress.mjs : 26 pass, 0 fail
Sections:
1. notify-island.ps1 schema round-trip (4 cases)
- all three new fields round-trip with explicit values
- step without total: step=5, total stays -1
- backward compat: step=-1, total=-1, detail=""
- existing fields (state/message/progress/ts/source) preserved
2. Build-DisplayMessage function contract (9 cases)
covering include step values, total omission, detail omission,
empty message, total=0 edge, step=-1 with orphan detail
3. Format-ToolSummary for mcode-computer-use (7 cases)
including Bash / Read / Edit regression coverage
4. Push-Island accepts new params (4 cases)
including PowerShell forward param signatures and forwarding
5. Push-Island end-to-end (hook -> status.json) (2 cases)

Test evidence (negative-injection verified)

Per the round-4 lesson (test pass != contract honored), I broke the
coordinate formatter in _lib.ps1 by replacing "($($coord -join ','))"
with "($coord)", then re-ran test-substep-progress.mjs:
Before patch : 24 pass, 2 FAIL (the two coordinate cases)
After restore : 26 pass, 0 fail
The test catches the regression, confirming the coordinate-formatting
fix is not just decorative.

Widget visual verified locally:
notify-island.ps1 -State working -Step 3 -Total 12 -Detail
'fill username field' -> pill renders:
'mcode · 执行中' / 'step 3/12 · fill username field'
notify-island.ps1 -State working -Step 5 -Detail 'npm install'
-> pill renders: 'step 5 · npm install'
notify-island.ps1 -State working -Message 'Read ok'
-> pill renders: 'Read ok' (legacy path, no step prefix)

Migration

No data migration. Existing status.json consumers see three new fields
they can ignore. Existing notify-island.ps1 callers see no behavior
change. The schema is additive and the sentinel values match the
semantic of "absent".

Reference

Companion docs updated:
skills/mcode-island/SKILL.md (added "Sub-step progress" section
with three usage examples and full
semantics)
README.md (added brief mention in the
notify-island.ps1 section with
a forward pointer to SKILL.md)
Bump plugin.json 0.3.0 -> 0.4.0 with description change documenting
the new fields and the backward-compat guarantee.
No upstream protocol changes. (Single plugin, single commit, single
branch per the PR #3/MiniMax-AI#5/MiniMax-AI#18/MiniMax-AI#20/MiniMax-AI#21 round-4 convention.)

Extends status.json schema with three optional fields — step, total,
detail — so agents can publish per-iteration progress during Computer
Use loops, multi-step plans, and long-running tool sequences. The widget
now renders "step N[/M] · detail" instead of only the coarse state, so
the user can see what the agent is doing right now without waiting for
it to finish.

## Surface changes

  notify-island.ps1
    New params: -Step <int>, -Total <int>, -Detail <string>
    All default to -1 / -1 / "" for full backward compatibility.
    The status.json payload now writes step/total/detail alongside the
    existing state/message/progress fields. Old callers (omitting the
    new params) produce identical status.json behavior except for three
    extra fields whose values are the sentinels.

  mcode-island.ps1 (widget)
    New Build-DisplayMessage helper that converts the schema fields into
    the visible pill text. Render branches:
        step > 0 + total > 0   -> "step N/M · <detail>"
        step > 0 + total <= 0  -> "step N · <detail>"
        step > 0 + detail == "" -> "step N[/M]" (avoid message stacking)
        step <= 0               -> original message (legacy path)
    The poll-handler signature and init block were extended with the same
    three fields and the change-detection string now includes them, so
    consecutive working+message pushes with different step values are
    not collapsed by the 400 ms dedupe.

  io.minimax.mcode/hooks/scripts/_lib.ps1
    Push-Island now accepts -Step/-Total/-Detail and forwards them to
    notify-island.ps1. Format-ToolSummary has a new mcode-computer-use
    branch that extracts action + coordinate with explicit -join ","
    so coordinate arrays render as "(x,y)" not PowerShell's default
    "(x y)" (the latter looked like a truncated number on the pill).

  io.minimax.mcode/hooks/scripts/post-tool-use.ps1
    Pushes -Detail with the Format-ToolSummary output split so the pill
    shows "Bash ok · ls -la /tmp" instead of "Bash ok". pre-tool-use.ps1
    already used Format-ToolSummary so no change there.

## Backward compatibility

All new schema fields are optional. notify-island.ps1 callers that
omit -Step/-Total/-Detail see no behavior change. Widget versions that
do not know the new fields ignore them (PSObject.Properties[name]
everywhere). Verified by smoke.mjs case "backward compat: old callers
produce step=-1, total=-1, detail=""" and test-substep-progress.mjs
case "Push-Island backward compat: missing new params -> step=-1,
total=-1, detail=""".

## Design compliance (per PR MiniMax-AI#21 round-11 standards)

  no credentials      : none added; the IPC is local-filesystem only
  no network          : no network calls added; notify-island.ps1 still
                        writes status.json under %APPDATA%/mcode-island
  no telemetry        : no telemetry added; the existing append-only
                        island.log is unchanged and the 400 ms polling
                        cadence is unchanged
  no third-party svcs : no new third-party deps; the change is pure
                        PowerShell + schema
  cross-platform      : no hardcoded host paths; no /Users/ /home/
                        C:\ /mnt/ literals introduced; the existing
                        smoke.mjs cross-platform scan still passes
  atomic write        : notify-island.ps1 already writes status.json
                        atomically via staging + rename; no change
  closed schema       : status.json is open by design (not contract-
                        locked), but each new field has a documented
                        sentinel (-1 / -1 / "") so absent fields are
                        semantically equivalent to explicit sentinels
  smoke self-check    : smoke.mjs gained 5 new checks under section
                        5c1; locked the new surface contract so a
                        future refactor that drops the params surfaces
                        in smoke before reaching the slower pwsh-spawned
                        tests

## Validation

  smoke.mjs                          : 48 pass, 7 warn, 0 fail
    (7 warn are pre-existing "forward" event catalog entries pending
     mcode 0.2.4+ Runtime confirmation; unchanged by this PR)

  scripts/test-substep-progress.mjs  : 26 pass, 0 fail
    Sections:
      1. notify-island.ps1 schema round-trip        (4 cases)
         - all three new fields round-trip with explicit values
         - step without total: step=5, total stays -1
         - backward compat: step=-1, total=-1, detail=""
         - existing fields (state/message/progress/ts/source) preserved
      2. Build-DisplayMessage function contract   (9 cases)
         covering include step values, total omission, detail omission,
         empty message, total=0 edge, step=-1 with orphan detail
      3. Format-ToolSummary for mcode-computer-use (7 cases)
         including Bash / Read / Edit regression coverage
      4. Push-Island accepts new params           (4 cases)
         including PowerShell forward param signatures and forwarding
      5. Push-Island end-to-end (hook -> status.json) (2 cases)

## Test evidence (negative-injection verified)

  Per the round-4 lesson (test pass != contract honored), I broke the
  coordinate formatter in _lib.ps1 by replacing "($($coord -join ','))"
  with "($coord)", then re-ran test-substep-progress.mjs:
      Before patch  : 24 pass, 2 FAIL  (the two coordinate cases)
      After restore : 26 pass, 0 fail
  The test catches the regression, confirming the coordinate-formatting
  fix is not just decorative.

  Widget visual verified locally:
      notify-island.ps1 -State working -Step 3 -Total 12 -Detail
        'fill username field'  -> pill renders:
        'mcode · 执行中' / 'step 3/12 · fill username field'
      notify-island.ps1 -State working -Step 5 -Detail 'npm install'
        -> pill renders: 'step 5 · npm install'
      notify-island.ps1 -State working -Message 'Read ok'
        -> pill renders: 'Read ok'  (legacy path, no step prefix)

## Migration

  No data migration. Existing status.json consumers see three new fields
  they can ignore. Existing notify-island.ps1 callers see no behavior
  change. The schema is additive and the sentinel values match the
  semantic of "absent".

## Reference

  Companion docs updated:
    skills/mcode-island/SKILL.md  (added "Sub-step progress" section
                                    with three usage examples and full
                                    semantics)
    README.md                     (added brief mention in the
                                    notify-island.ps1 section with
                                    a forward pointer to SKILL.md)
  Bump plugin.json 0.3.0 -> 0.4.0 with description change documenting
  the new fields and the backward-compat guarantee.
  No upstream protocol changes. (Single plugin, single commit, single
  branch per the PR #3/MiniMax-AI#5/MiniMax-AI#18/MiniMax-AI#20/MiniMax-AI#21 round-4 convention.)
@antianqi

Copy link
Copy Markdown
Owner Author

Opened against the wrong base — should target MiniMax-AI/MiniMax-Code-Plugins:main, not this fork's main. Reopening against the upstream.

@antianqi antianqi closed this Sep 23, 2026
antianqi added a commit that referenced this pull request Sep 23, 2026
Extends status.json schema with three optional fields — step, total,
detail — so agents can publish per-iteration progress during Computer
Use loops, multi-step plans, and long-running tool sequences. The widget
now renders "step N[/M] · detail" instead of only the coarse state, so
the user can see what the agent is doing right now without waiting for
it to finish.

  notify-island.ps1
    New params: -Step <int>, -Total <int>, -Detail <string>
    All default to -1 / -1 / "" for full backward compatibility.
    The status.json payload now writes step/total/detail alongside the
    existing state/message/progress fields. Old callers (omitting the
    new params) produce identical status.json behavior except for three
    extra fields whose values are the sentinels.

  mcode-island.ps1 (widget)
    New Build-DisplayMessage helper that converts the schema fields into
    the visible pill text. Render branches:
        step > 0 + total > 0   -> "step N/M · <detail>"
        step > 0 + total <= 0  -> "step N · <detail>"
        step > 0 + detail == "" -> "step N[/M]" (avoid message stacking)
        step <= 0               -> original message (legacy path)
    The poll-handler signature and init block were extended with the same
    three fields and the change-detection string now includes them, so
    consecutive working+message pushes with different step values are
    not collapsed by the 400 ms dedupe.

  io.minimax.mcode/hooks/scripts/_lib.ps1
    Push-Island now accepts -Step/-Total/-Detail and forwards them to
    notify-island.ps1. Format-ToolSummary has a new mcode-computer-use
    branch that extracts action + coordinate with explicit -join ","
    so coordinate arrays render as "(x,y)" not PowerShell's default
    "(x y)" (the latter looked like a truncated number on the pill).

  io.minimax.mcode/hooks/scripts/post-tool-use.ps1
    Pushes -Detail with the Format-ToolSummary output split so the pill
    shows "Bash ok · ls -la /tmp" instead of "Bash ok". pre-tool-use.ps1
    already used Format-ToolSummary so no change there.

All new schema fields are optional. notify-island.ps1 callers that
omit -Step/-Total/-Detail see no behavior change. Widget versions that
do not know the new fields ignore them (PSObject.Properties[name]
everywhere). Verified by smoke.mjs case "backward compat: old callers
produce step=-1, total=-1, detail=""" and test-substep-progress.mjs
case "Push-Island backward compat: missing new params -> step=-1,
total=-1, detail=""".

  no credentials      : none added; the IPC is local-filesystem only
  no network          : no network calls added; notify-island.ps1 still
                        writes status.json under %APPDATA%/mcode-island
  no telemetry        : no telemetry added; the existing append-only
                        island.log is unchanged and the 400 ms polling
                        cadence is unchanged
  no third-party svcs : no new third-party deps; the change is pure
                        PowerShell + schema
  cross-platform      : no hardcoded host paths; no /Users/ /home/
                        C:\ /mnt/ literals introduced; the existing
                        smoke.mjs cross-platform scan still passes
  atomic write        : notify-island.ps1 already writes status.json
                        atomically via staging + rename; no change
  closed schema       : status.json is open by design (not contract-
                        locked), but each new field has a documented
                        sentinel (-1 / -1 / "") so absent fields are
                        semantically equivalent to explicit sentinels
  smoke self-check    : smoke.mjs gained 5 new checks under section
                        5c1; locked the new surface contract so a
                        future refactor that drops the params surfaces
                        in smoke before reaching the slower pwsh-spawned
                        tests

  smoke.mjs                          : 48 pass, 7 warn, 0 fail
    (7 warn are pre-existing "forward" event catalog entries pending
     mcode 0.2.4+ Runtime confirmation; unchanged by this PR)

  scripts/test-substep-progress.mjs  : 26 pass, 0 fail
    Sections:
      1. notify-island.ps1 schema round-trip        (4 cases)
         - all three new fields round-trip with explicit values
         - step without total: step=5, total stays -1
         - backward compat: step=-1, total=-1, detail=""
         - existing fields (state/message/progress/ts/source) preserved
      2. Build-DisplayMessage function contract   (9 cases)
         covering include step values, total omission, detail omission,
         empty message, total=0 edge, step=-1 with orphan detail
      3. Format-ToolSummary for mcode-computer-use (7 cases)
         including Bash / Read / Edit regression coverage
      4. Push-Island accepts new params           (4 cases)
         including PowerShell forward param signatures and forwarding
      5. Push-Island end-to-end (hook -> status.json) (2 cases)

  Per the round-4 lesson (test pass != contract honored), I broke the
  coordinate formatter in _lib.ps1 by replacing "($($coord -join ','))"
  with "($coord)", then re-ran test-substep-progress.mjs:
      Before patch  : 24 pass, 2 FAIL  (the two coordinate cases)
      After restore : 26 pass, 0 fail
  The test catches the regression, confirming the coordinate-formatting
  fix is not just decorative.

  Widget visual verified locally:
      notify-island.ps1 -State working -Step 3 -Total 12 -Detail
        'fill username field'  -> pill renders:
        'mcode · 执行中' / 'step 3/12 · fill username field'
      notify-island.ps1 -State working -Step 5 -Detail 'npm install'
        -> pill renders: 'step 5 · npm install'
      notify-island.ps1 -State working -Message 'Read ok'
        -> pill renders: 'Read ok'  (legacy path, no step prefix)

  No data migration. Existing status.json consumers see three new fields
  they can ignore. Existing notify-island.ps1 callers see no behavior
  change. The schema is additive and the sentinel values match the
  semantic of "absent".

  Companion docs updated:
    skills/mcode-island/SKILL.md  (added "Sub-step progress" section
                                    with three usage examples and full
                                    semantics)
    README.md                     (added brief mention in the
                                    notify-island.ps1 section with
                                    a forward pointer to SKILL.md)
  Bump plugin.json 0.3.0 -> 0.4.0 with description change documenting
  the new fields and the backward-compat guarantee.
  No upstream protocol changes. (Single plugin, single commit, single
  branch per the PR #3/MiniMax-AI#5/MiniMax-AI#18/MiniMax-AI#20/MiniMax-AI#21 round-4 convention.)
antianqi added a commit that referenced this pull request Sep 23, 2026
Extends status.json schema with three optional fields — step, total,
detail — so agents can publish per-iteration progress during Computer
Use loops, multi-step plans, and long-running tool sequences. The widget
now renders "step N[/M] · detail" instead of only the coarse state, so
the user can see what the agent is doing right now without waiting for
it to finish.

  notify-island.ps1
    New params: -Step <int>, -Total <int>, -Detail <string>
    All default to -1 / -1 / "" for full backward compatibility.
    The status.json payload now writes step/total/detail alongside the
    existing state/message/progress fields. Old callers (omitting the
    new params) produce identical status.json behavior except for three
    extra fields whose values are the sentinels.

  mcode-island.ps1 (widget)
    New Build-DisplayMessage helper that converts the schema fields into
    the visible pill text. Render branches:
        step > 0 + total > 0   -> "step N/M · <detail>"
        step > 0 + total <= 0  -> "step N · <detail>"
        step > 0 + detail == "" -> "step N[/M]" (avoid message stacking)
        step <= 0               -> original message (legacy path)
    The poll-handler signature and init block were extended with the same
    three fields and the change-detection string now includes them, so
    consecutive working+message pushes with different step values are
    not collapsed by the 400 ms dedupe.

  io.minimax.mcode/hooks/scripts/_lib.ps1
    Push-Island now accepts -Step/-Total/-Detail and forwards them to
    notify-island.ps1. Format-ToolSummary has a new mcode-computer-use
    branch that extracts action + coordinate with explicit -join ","
    so coordinate arrays render as "(x,y)" not PowerShell's default
    "(x y)" (the latter looked like a truncated number on the pill).

  io.minimax.mcode/hooks/scripts/post-tool-use.ps1
    Pushes -Detail with the Format-ToolSummary output split so the pill
    shows "Bash ok · ls -la /tmp" instead of "Bash ok". pre-tool-use.ps1
    already used Format-ToolSummary so no change there.

All new schema fields are optional. notify-island.ps1 callers that
omit -Step/-Total/-Detail see no behavior change. Widget versions that
do not know the new fields ignore them (PSObject.Properties[name]
everywhere). Verified by smoke.mjs case "backward compat: old callers
produce step=-1, total=-1, detail=""" and test-substep-progress.mjs
case "Push-Island backward compat: missing new params -> step=-1,
total=-1, detail=""".

  no credentials      : none added; the IPC is local-filesystem only
  no network          : no network calls added; notify-island.ps1 still
                        writes status.json under %APPDATA%/mcode-island
  no telemetry        : no telemetry added; the existing append-only
                        island.log is unchanged and the 400 ms polling
                        cadence is unchanged
  no third-party svcs : no new third-party deps; the change is pure
                        PowerShell + schema
  cross-platform      : no hardcoded host paths; no /Users/ /home/
                        C:\ /mnt/ literals introduced; the existing
                        smoke.mjs cross-platform scan still passes
  atomic write        : notify-island.ps1 already writes status.json
                        atomically via staging + rename; no change
  closed schema       : status.json is open by design (not contract-
                        locked), but each new field has a documented
                        sentinel (-1 / -1 / "") so absent fields are
                        semantically equivalent to explicit sentinels
  smoke self-check    : smoke.mjs gained 5 new checks under section
                        5c1; locked the new surface contract so a
                        future refactor that drops the params surfaces
                        in smoke before reaching the slower pwsh-spawned
                        tests

  smoke.mjs                          : 48 pass, 7 warn, 0 fail
    (7 warn are pre-existing "forward" event catalog entries pending
     mcode 0.2.4+ Runtime confirmation; unchanged by this PR)

  scripts/test-substep-progress.mjs  : 26 pass, 0 fail
    Sections:
      1. notify-island.ps1 schema round-trip        (4 cases)
         - all three new fields round-trip with explicit values
         - step without total: step=5, total stays -1
         - backward compat: step=-1, total=-1, detail=""
         - existing fields (state/message/progress/ts/source) preserved
      2. Build-DisplayMessage function contract   (9 cases)
         covering include step values, total omission, detail omission,
         empty message, total=0 edge, step=-1 with orphan detail
      3. Format-ToolSummary for mcode-computer-use (7 cases)
         including Bash / Read / Edit regression coverage
      4. Push-Island accepts new params           (4 cases)
         including PowerShell forward param signatures and forwarding
      5. Push-Island end-to-end (hook -> status.json) (2 cases)

  Per the round-4 lesson (test pass != contract honored), I broke the
  coordinate formatter in _lib.ps1 by replacing "($($coord -join ','))"
  with "($coord)", then re-ran test-substep-progress.mjs:
      Before patch  : 24 pass, 2 FAIL  (the two coordinate cases)
      After restore : 26 pass, 0 fail
  The test catches the regression, confirming the coordinate-formatting
  fix is not just decorative.

  Widget visual verified locally:
      notify-island.ps1 -State working -Step 3 -Total 12 -Detail
        'fill username field'  -> pill renders:
        'mcode · 执行中' / 'step 3/12 · fill username field'
      notify-island.ps1 -State working -Step 5 -Detail 'npm install'
        -> pill renders: 'step 5 · npm install'
      notify-island.ps1 -State working -Message 'Read ok'
        -> pill renders: 'Read ok'  (legacy path, no step prefix)

  No data migration. Existing status.json consumers see three new fields
  they can ignore. Existing notify-island.ps1 callers see no behavior
  change. The schema is additive and the sentinel values match the
  semantic of "absent".

  Companion docs updated:
    skills/mcode-island/SKILL.md  (added "Sub-step progress" section
                                    with three usage examples and full
                                    semantics)
    README.md                     (added brief mention in the
                                    notify-island.ps1 section with
                                    a forward pointer to SKILL.md)
  Bump plugin.json 0.3.0 -> 0.4.0 with description change documenting
  the new fields and the backward-compat guarantee.
  No upstream protocol changes. (Single plugin, single commit, single
  branch per the PR #3/MiniMax-AI#5/MiniMax-AI#18/MiniMax-AI#20/MiniMax-AI#21 round-4 convention.)
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