-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add manifest process state grammar #195
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Badger Book initialized | ||
|
|
||
| Version: 0.0.1 | ||
| Date: 2026-06-07 | ||
| Initialized: 2026-06-09 | ||
| Updated: 2026-06-09 | ||
|
|
||
| ## Issue Tracker | ||
|
|
||
| - Type: GitHub Issues + GitHub Project | ||
| - Repository: https://github.com/modoterra/stasium | ||
| - Project: https://github.com/orgs/modoterra/projects/1 | ||
|
|
||
| ## Labels And Status | ||
|
|
||
| Labels are for triage/readiness: | ||
|
|
||
| - `needs-triage` | ||
| - `needs-info` | ||
| - `ready-for-agent` | ||
| - `ready-for-human` | ||
| - `wontfix` | ||
|
|
||
| GitHub Project `Status` is for delivery progress: | ||
|
|
||
| - `Todo` | ||
| - `In Progress` | ||
| - `In Review` | ||
| - `Ready to Merge` | ||
| - `Done` | ||
| - `Blocked` | ||
|
|
||
| Do not duplicate delivery progress as labels while the GitHub Project is configured. | ||
|
|
||
| Rerun `/initialize` when workflow labels, Project fields, or `docs/agents` drift. |
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 |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| # Triage Labels | ||
|
|
||
| The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker. | ||
| The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker. Delivery progress lives in the GitHub Project `Status` field, not in labels. | ||
|
|
||
| | Label in mattpocock/skills | Label in our tracker | Project `Status` | Meaning | | ||
| | -------------------------- | -------------------- | ----------------- | ---------------------------------------- | | ||
| | `needs-triage` | `needs-triage` | `Needs triage` | Maintainer needs to evaluate this issue | | ||
| | `needs-info` | `needs-info` | `Needs info` | Waiting on reporter for more information | | ||
| | `ready-for-agent` | `ready-for-agent` | `Ready for agent` | Fully specified, ready for an AFK agent | | ||
| | `ready-for-human` | `ready-for-human` | `Ready for human` | Requires human implementation | | ||
| | `wontfix` | `wontfix` | `Won't fix` | Will not be actioned | | ||
| | Label in mattpocock/skills | Label in our tracker | Meaning | | ||
| | -------------------------- | -------------------- | ---------------------------------------- | | ||
| | `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue | | ||
| | `needs-info` | `needs-info` | Waiting on reporter for more information | | ||
| | `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent | | ||
| | `ready-for-human` | `ready-for-human` | Requires human implementation | | ||
| | `wontfix` | `wontfix` | Will not be actioned | | ||
|
|
||
| When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table and set the matching Project `Status` when the issue is in the `Stasium` Project. | ||
| When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table. | ||
|
|
||
| Issues with no triage label should usually be placed in `Needs triage`. Use `In progress` for actively owned work and `Done` for completed Project items. | ||
| Issues with no triage label should usually be placed in `needs-triage`. Use the GitHub Project `Status` field for active delivery states such as `In Progress`, `In Review`, `Ready to Merge`, `Done`, and `Blocked`. |
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
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
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
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
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,37 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
| import { | ||
| getDirectManagedRuntimeStatus, | ||
| getExternalRuntimeStatus, | ||
| getRuntimeStatusView, | ||
| } from "./runtime-status"; | ||
|
|
||
| describe("runtime status", () => { | ||
| test("uses user-facing codes for canonical statuses", () => { | ||
| expect(getRuntimeStatusView("running")).toMatchObject({ code: "Run", label: "running" }); | ||
| expect(getRuntimeStatusView("retrying")).toMatchObject({ code: "Rty", label: "retrying" }); | ||
| expect(getRuntimeStatusView("errored")).toMatchObject({ code: "Err", label: "errored" }); | ||
| expect(getRuntimeStatusView("blocked")).toMatchObject({ code: "Blk", label: "blocked" }); | ||
| expect(getRuntimeStatusView("paused")).toMatchObject({ code: "Pau", label: "paused" }); | ||
| expect(getRuntimeStatusView("unknown")).toMatchObject({ code: "Unk", label: "unknown" }); | ||
| }); | ||
|
|
||
| test("normalizes direct-managed service states", () => { | ||
| expect(getDirectManagedRuntimeStatus("RUNNING", null)).toBe("running"); | ||
| expect(getDirectManagedRuntimeStatus("STARTING", null)).toBe("starting"); | ||
| expect(getDirectManagedRuntimeStatus("STOPPING", null)).toBe("stopping"); | ||
| expect(getDirectManagedRuntimeStatus("FAILED", null)).toBe("errored"); | ||
| expect(getDirectManagedRuntimeStatus("BLOCKED", null)).toBe("blocked"); | ||
| expect(getDirectManagedRuntimeStatus("STOPPED", null)).toBe("off"); | ||
| expect(getDirectManagedRuntimeStatus("FAILED", 250)).toBe("retrying"); | ||
| }); | ||
|
|
||
| test("normalizes external runtime states", () => { | ||
| expect(getExternalRuntimeStatus("running")).toBe("running"); | ||
| expect(getExternalRuntimeStatus("restarting")).toBe("retrying"); | ||
| expect(getExternalRuntimeStatus("dead")).toBe("errored"); | ||
| expect(getExternalRuntimeStatus("paused")).toBe("paused"); | ||
| expect(getExternalRuntimeStatus("created")).toBe("off"); | ||
| expect(getExternalRuntimeStatus("exited")).toBe("off"); | ||
| expect(getExternalRuntimeStatus("unknown")).toBe("unknown"); | ||
| }); | ||
| }); |
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,74 @@ | ||
| import type { ExternalManagedProcessState, RuntimeStatus, ServiceState } from "./types"; | ||
|
|
||
| export interface RuntimeStatusView { | ||
| status: RuntimeStatus; | ||
| code: string; | ||
| label: string; | ||
| severity: "good" | "attention" | "bad" | "muted"; | ||
| } | ||
|
|
||
| export const getRuntimeStatusView = (status: RuntimeStatus): RuntimeStatusView => { | ||
| switch (status) { | ||
| case "running": | ||
| return { status, code: "Run", label: "running", severity: "good" }; | ||
| case "retrying": | ||
| return { status, code: "Rty", label: "retrying", severity: "attention" }; | ||
| case "errored": | ||
| return { status, code: "Err", label: "errored", severity: "bad" }; | ||
| case "blocked": | ||
| return { status, code: "Blk", label: "blocked", severity: "attention" }; | ||
| case "starting": | ||
| return { status, code: "Str", label: "starting", severity: "attention" }; | ||
| case "stopping": | ||
| return { status, code: "Stp", label: "stopping", severity: "attention" }; | ||
| case "off": | ||
| return { status, code: "Off", label: "off", severity: "muted" }; | ||
| case "paused": | ||
| return { status, code: "Pau", label: "paused", severity: "attention" }; | ||
| case "unknown": | ||
| return { status, code: "Unk", label: "unknown", severity: "muted" }; | ||
| } | ||
| }; | ||
|
|
||
| export const getDirectManagedRuntimeStatus = ( | ||
| state: ServiceState, | ||
| restartInMs: number | null, | ||
| ): RuntimeStatus => { | ||
| if (restartInMs !== null) return "retrying"; | ||
|
|
||
| switch (state) { | ||
| case "RUNNING": | ||
| return "running"; | ||
| case "STARTING": | ||
| return "starting"; | ||
| case "STOPPING": | ||
| return "stopping"; | ||
| case "FAILED": | ||
| return "errored"; | ||
| case "BLOCKED": | ||
| return "blocked"; | ||
| case "STOPPED": | ||
| return "off"; | ||
| } | ||
| }; | ||
|
|
||
| export const getExternalRuntimeStatus = (state: ExternalManagedProcessState): RuntimeStatus => { | ||
| switch (state) { | ||
| case "running": | ||
| return "running"; | ||
| case "restarting": | ||
| return "retrying"; | ||
| case "paused": | ||
| return "paused"; | ||
| case "dead": | ||
| return "errored"; | ||
| case "created": | ||
| return "off"; | ||
| case "removing": | ||
| return "starting"; | ||
| case "exited": | ||
| return "off"; | ||
| case "unknown": | ||
| return "unknown"; | ||
| } | ||
| }; | ||
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.
When Docker Compose reports a service as
created(and this adapter also assignscreatedto configured services with nopsentry insrc/docker.ts), the container is not running rather than actively starting; Docker'spsdocs listcreatedseparately fromrunning, whererunningis the state afterdocker start/docker run(https://docs.docker.com/reference/cli/docker/container/ls/). Mapping it tostartingmakes never-started Compose services showStrindefinitely and skews panel summaries/colors until the user starts them.Useful? React with 👍 / 👎.