Compare commits

..

No commits in common. "chore/openspec-hybrid" and "main" have entirely different histories.

464 changed files with 32 additions and 17758 deletions

View file

@ -1 +0,0 @@
opencode

View file

@ -1,215 +0,0 @@
---
name: openspec-apply-change
description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks. Also use when the user says "openspec apply", "opsx apply", or "openspec implement".
allowed-tools: Bash(openspec:*)
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
---
Implement tasks from an OpenSpec change.
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `lifecycle actions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
Otherwise, with no root, what happens next depends on how this workflow was reached:
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or invoking this skill by name. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or invoked this skill by name. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
**Input**: Optionally specify a change name (e.g., `openspec-apply-change add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
**Steps**
1. **Select the change**
If a name is provided, use it. Otherwise:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
Always announce: "Using change: <name>" and how to override (e.g., `openspec-apply-change <other>`).
2. **Check status to understand the schema**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to understand:
- `schemaName`: The workflow being used (e.g., "spec-driven")
- `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
3. **Get apply instructions**
```bash
openspec instructions apply --change "<name>" --json
```
This returns:
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
- Progress (total, complete, remaining)
- Task list with status, source path, and source line
- Dynamic instruction based on current state
- Optional `context`: current required project instruction input from the selected root
- Optional `operationGuidance`: current advisory guidance for apply
- `missingArtifacts` (when present): required artifact ids with no output
- Optional `lifecycle` (`before`, `completed`, `handling`) or `lifecycleError`: project lifecycle actions for this run. Older CLIs omit both. When both are absent, skip every lifecycle step below.
**Handle states:**
- If `state: "blocked"`: show the message and pause implementation. Skip lifecycle actions.
- If `missingArtifacts` is non-empty: show the missing artifacts and the recovery step from the CLI’s `instruction` field. Keep the selected store on any follow-up command.
- Otherwise, follow the CLI instruction to create or repair the schema-configured tracking file from existing planning artifacts. Do not assume another artifact is ready or start implementation while blocked.
- If `state: "all_done"`: report that all tracked tasks are complete and suggest review or verification as appropriate before archiving. Skip `lifecycle.before`. If `lifecycle.completed` is present, read every `contextFiles` path first, then handle it following `lifecycle.handling`. If `lifecycleError` is present, report it and finish.
- Otherwise: proceed to implementation
Treat `context` as a required prompt-level input. Read and consider it, and
apply relevant project facts, conventions, and constraints while implementing.
Treat `operationGuidance` as optional additive advice. Read and consider every
entry, and follow entries that are applicable and compatible with the built-in
workflow.
Keep both fields separate from CLI-returned state, missing artifacts, tasks,
progress, `contextFiles`, and the built-in `instruction`. They are not
evidence of task completion, do not replace the built-in instruction, and do
not permit bypassing a blocked state. If context conflicts with the built-in
instruction, an explicit user choice, or a CLI-controlled value, report the
conflict and preserve the controlling value. If guidance is inapplicable or
conflicts with those controlling inputs, do not follow it and explain why.
These are prompt-level behavior contracts, not enforceable checks.
4. **Read context files**
Read every file path listed under `contextFiles` from the apply instructions output.
The files depend on the schema being used:
- **spec-driven**: proposal, specs, design, tasks
- Other schemas: follow the contextFiles from CLI output
Do not copy `context` or `operationGuidance` verbatim into implementation
files or planning artifacts unless the user separately asks for that content.
When ready to implement, once per start or resume and before any edits:
- If `lifecycleError` is present: report its `issues` and `fix`, and stop before editing anything.
- If `lifecycle.before` is present: handle it following `lifecycle.handling`.
5. **Show current progress**
Display:
- Schema being used
- Progress: "N/M tasks complete"
- Remaining tasks overview
- Dynamic instruction from CLI
6. **Implement tasks (loop until done or blocked)**
For each pending task:
- Show which task is being worked on
- Make the code changes required
- Keep changes minimal and focused
- Before editing, confirm the checkbox at the returned `sourcePath` and `line` still matches the task description; if it does not, rerun the apply instructions and use the refreshed location
- Mark the task complete at its returned `sourcePath` and `line`: `- [ ]` → `- [x]`
- Rerun the apply instructions and confirm that task is now done and progress changed
- Continue to next task
Ignore `lifecycle` and `lifecycleError` on these reruns. Lifecycle actions come only from the Step 3 read.
**Pause if:**
- Task is unclear → ask for clarification
- Implementation reveals a design issue → suggest updating artifacts
- A task needs work beyond what the spec and tasks describe, or you are tempted to drop, narrow, defer, or accept exceptions to specified behavior to make it fit → surface the added scope and ask; do not absorb it silently
- Error or blocker encountered → report and wait for guidance
- User interrupts
7. **On completion or pause, show status**
Display:
- Tasks completed this session
- Overall progress: "N/M tasks complete"
- If all done (the latest apply response has `state: "all_done"` on tracked schemas, or implementation finished without pausing on schemas without task tracking): report completion and suggest review or verification as appropriate before archiving. Then, if `lifecycle.completed` from Step 3 is present, handle it once following `lifecycle.handling`. If `lifecycleError` is present, report it and finish.
- If paused: explain why and wait for guidance. Do not handle `lifecycle.completed`.
**Output During Implementation**
```
## Implementing: <change-name> (schema: <schema-name>)
Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete
Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
```
**Output On Completion**
```
## Implementation Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓
### Completed This Session
- [x] Task 1
- [x] Task 2
...
All tracked tasks are complete. Review or verify the change as appropriate
before archiving. Review the completed work, then ask to archive this change.
```
**Output On Pause (Issue Encountered)**
```
## Implementation Paused
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete
### Issue Encountered
<description of the issue>
**Options:**
1. <option 1>
2. <option 2>
3. Other approach
What would you like to do?
```
**Guardrails**
- Keep going through tasks until done or blocked
- Always read context files before starting (from the apply instructions output)
- If task is ambiguous, pause and ask before implementing
- If implementation reveals issues, pause and suggest artifact updates
- Keep code changes minimal and scoped to each task
- Update task checkbox immediately after completing each task
- Pause on errors, blockers, or unclear requirements - don't guess
- When a task needs work beyond what the spec describes, surface the added scope and pause - never silently narrow, defer, or simplify away specified behavior
- Only mark a task `- [x]` when its specified behavior is fully implemented, not when it is partially done or deferred
- Use contextFiles from CLI output, don't assume specific file names
- Use each task's sourcePath and line to update its exact checkbox
- Do not use context or operation guidance as proof that a task is complete
- Apply relevant project context; report conflicts with controlling workflow inputs
- Consider every guidance entry; explain any inapplicable or conflicting advice
- Do not copy runtime context or operation guidance into implementation files or planning artifacts
- Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
- Take lifecycle actions only from the Step 3 read, never from `openspec lifecycle actions`
- Handle `lifecycle.before` once before edits and `lifecycle.completed` once when Apply finishes implementing (`state: "all_done"` on tracked schemas, or after finishing without pausing on schemas without task tracking), never when blocked or paused
- What an action does, including pausing for input, comes from its own `instructions`
**Fluid Workflow Integration**
This skill supports the "actions on a change" model:
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly

View file

@ -1,241 +0,0 @@
---
name: openspec-archive-change
description: Archive a completed OpenSpec change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete. Also use when the user says "openspec archive" or "opsx archive".
allowed-tools: Bash(openspec:*)
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
---
Archive a completed change in the experimental workflow.
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `lifecycle actions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
Otherwise, with no root, what happens next depends on how this workflow was reached:
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or invoking this skill by name. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or invoked this skill by name. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
**Steps**
1. **Select the change**
If a name is provided, use it. Otherwise:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
When prompting, show only active changes (not already archived).
Include the schema used for each change if available.
Always announce: "Using change: <name>" and how to override (e.g., `openspec-archive-change <other>`).
**Load current archive inputs before the existing archive checks:**
After resolving the selected change and planning root, run this once for the archive:
```bash
openspec instructions archive --change "<name>" --json
```
Keep the same selected-root flags on this command. This lookup is advisory and
optional: a failed lookup must never block archiving.
If it exits non-zero or returns invalid JSON — for example on an older CLI that
does not support this command yet — continue the archive workflow with no
context, no operation guidance, and no lifecycle actions.
Do not report an error and do not stop.
A successful response may omit every optional field. Treat `context` as a
required prompt-level input: read and consider it, and apply relevant project
facts, conventions, and constraints. Treat `operationGuidance` as optional
additive advice: read and consider every entry, and follow entries that are
applicable and compatible with the built-in archive workflow.
Keep both fields separate from built-in steps, explicit user choices, resolved
paths, CLI checks, and command contracts. If context conflicts with one of those
controlling inputs, report the conflict and preserve the controlling value. If
guidance is inapplicable or conflicts with a controlling input, do not follow it
and explain why. Do not infer replacement paths, skipped prompts, or flags from
either field, and do not copy their text verbatim into specs, change artifacts,
or archive summaries unless the user separately asks for it. These are
prompt-level behavior contracts, not enforceable checks.
The response may also include `lifecycle` (`before`, `completed`,
`handling`) or `lifecycleError`: project lifecycle actions for this archive.
Older CLIs omit both. When both are absent, skip every lifecycle step below.
2. **Check artifact completion status**
Run `openspec status --change "<name>" --json` to check artifact completion.
Parse the JSON to understand:
- `schemaName`: The workflow being used
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
- `artifacts`: List of artifacts with their status (`done`, `skipped`, or other)
**If any artifacts are neither `done` nor `skipped`** (skipped artifacts satisfy the requirement - the change declares skip_specs):
- Display warning listing incomplete artifacts
- Ask the user to confirm they want to proceed
- Proceed if user confirms
3. **Check task completion status**
Run `openspec list --json` with the same selected-root flags and find the
entry in `changes` whose `name` exactly matches the selected change.
Require exactly one match and nonnegative integer `totalTasks` and
`completedTasks`, with `completedTasks <= totalTasks`. The CLI resolves
the schema's tracked task files, including custom artifact names, output
paths, and globs.
Incomplete tasks = `totalTasks - completedTasks`.
Do not infer task completion from artifact status or the absence of a
top-level `tasks.md`. If the lookup fails, returns invalid JSON, omits or
duplicates the selected change, or returns invalid counts, report the problem
and stop before syncing or archiving.
The CLI counts only `x`/`X` checkbox markers as complete;
other markers, including unfamiliar ones, remain incomplete.
**If incomplete tasks found:**
- Display warning showing count of incomplete tasks
- Ask the user to confirm they want to proceed
- Proceed if user confirms
**If `totalTasks` is zero:** Proceed without a task-related warning.
4. **Assess delta spec sync state**
If `lifecycleError` is present: report its `issues` and `fix`, and stop before syncing specs or moving the change. Archiving never reaches `lifecycle.completed` on a broken config.
**Check the archive target first:** Record the target name as `<target-name>`: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<change-name>`. Never stack a second date (same rule as `openspec archive`).
If `<planningHome.changesDir>/archive/<target-name>` already exists, stop before writing any main spec. Report the collision, name any main specs this run already synced, leave `changeRoot` where it is, and suggest renaming the existing archive or this change.
Use `artifactPaths.specs.existingOutputPaths` from status JSON as the only
delta-spec source. If the `specs` entry is missing or
`existingOutputPaths` is empty, skip sync and continue at the archive target recheck below.
The before actions still apply. Do not infer delta specs from other artifacts.
**If delta specs exist:**
- Compare each delta spec with its corresponding main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 2, not a hardcoded repo path)
- A missing main spec is **not automatically** "already synced". For a new capability, the main spec is an *output* of the sync, not an input:
- If the delta has MODIFIED or RENAMED requirements, report that only ADDED requirements can create a new main spec and mark that capability as sync-blocked. Never invent a requirement that has no current version.
- Otherwise, if the delta has only REMOVED requirements and the change's `.openspec.yaml` declares `retire_capabilities: true`, the capability is already retired: count it as already synced, warn that there is nothing left to remove, and do not recreate the main spec. Apply this rule both now and when verifying a completed sync.
- Otherwise, if the delta has no ADDED requirements, report that no sync is possible and mark that capability as sync-blocked. For a REMOVED-only delta, warn that there is no main spec to remove from and leave the main-spec tree unchanged. `openspec archive` refuses the unmarked REMOVED-only case with `Spec must have at least one requirement`.
- Otherwise, count the capability as needing sync and name it in the summary (`<capability-path>: new main spec will be created`). If the delta also has REMOVED requirements, warn that they will be ignored because there is no main spec to remove from. The sync creates the main spec from only the delta's ADDED requirements, exactly as `openspec archive` does.
- Determine what changes would be applied (adds, modifications, removals, renames)
- Continue assessing the remaining capabilities even when one is sync-blocked. Show a combined summary before prompting.
**Prompt options:**
- If any capability is sync-blocked: explain why and offer only "Archive without syncing", "Cancel"
- Otherwise, if changes needed: "Sync now (recommended)", "Archive without syncing", "Cancel"
- Otherwise, if already synced: "Archive now", "Sync anyway", "Cancel"
Route on the answer:
- "Cancel" — stop, do not archive
- "Archive without syncing" or "Archive now" — skip sync and continue through the checks below
- "Sync now" or "Sync anyway" — select sync, then continue through the checks below. Do not start any sync while a capability is sync-blocked; explain the blocker and repeat the available choices.
- Anything else — ask again rather than archiving
After a pause, reuse the archive inputs from step 1 without fetching them again. Check the archive target again now. If `<planningHome.changesDir>/archive/<target-name>` exists, stop before writing any main spec, leave `changeRoot` where it is, and suggest renaming the existing archive or this change.
**Only if syncing was selected**, run
`openspec instructions specs --change "<name>" --json` once with the same
selected-root flags. Require a zero exit status and valid artifact-instruction
JSON. If the lookup fails or returns invalid JSON, report the error and stop
before writing any main spec or moving the change. A valid response with omitted
`rules` is the no-rules case. Apply returned `rules` only to the content and
form of main specs produced by this merge; do not use them as archive guidance,
change CLI behavior, or copy the rule text into any output file.
If `lifecycle.before` is present, handle it once following `lifecycle.handling`, whether or not you are syncing. If an action pauses, recheck the archive target before writing.
If syncing was not selected, skip sync and its verification and proceed to step 5.
Then run the `openspec-sync-specs` workflow inline if that skill is installed, or otherwise perform the delta-to-main-spec merge inline yourself (an agent-driven intelligent merge either way) for change '<name>', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching `specs` instructions again. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
If the sync reports any stop or blocking condition, treat the sync as failed.
Stop the archive immediately. Do not perform the post-sync content comparison and do not move its `changeRoot`.
Nothing has moved, so the user can fix the blocking condition or re-run the sync.
After the sync writes each main spec, verify its structure against the canonical sync contract:
- A new main spec starts with a `# <capability> Specification` title. An existing main spec keeps its title exactly as it is.
- Preserve existing `## Purpose` sections completely untouched for established main specs.
- For a new main spec, copy the delta `## Purpose` verbatim. Warn only if the purpose text is shorter than standard validation expects. Do not regenerate or rewrite existing authored purpose. If no usable `## Purpose` is provided, use the existing TBD Purpose behavior and warning.
- Verify that no delta-style section headers (`## ADDED Requirements`, `## MODIFIED Requirements`, `## REMOVED Requirements`, `## RENAMED Requirements`) remain in the main spec, adhering strictly to the sync workflow formatting rules.
- Requirement blocks the sync wrote or changed use `### Requirement:` headings, and their scenarios use `#### Scenario:` headings, under the spec's `## Requirements` section. Leave content the delta does not mention exactly as it is.
Then re-run the comparison from the top of this step, including the explicitly retired, missing-spec case, against every capability that has a delta spec in `artifactPaths.specs.existingOutputPaths` — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
- ADDED requirements present
- MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
- REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty.
- RENAMED requirements present under the new name and absent under the old one
If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and `changeRoot` is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
5. **Perform the archive**
Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
```bash
mkdir -p "<planningHome.changesDir>/archive"
```
Use the `<target-name>` recorded in step 4, unchanged.
**Check again immediately before the move:**
- If the target now exists: Fail with error, leave `changeRoot` where it is, report any main specs step 4 synced, and suggest renaming the existing archive or this change
- If not: Move `changeRoot` to the archive directory
```bash
mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
```
After the move, if `lifecycle.completed` is present, handle it once following `lifecycle.handling`, whether or not specs were synced. The change now lives at its archive path.
6. **Display summary**
Show archive completion summary including:
- Change name
- Schema that was used
- Archive location
- Whether specs were synced (if applicable)
- Note about any warnings (incomplete artifacts/tasks)
**Output On Success**
```markdown
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
**Specs:** <"✓ Synced to main specs" only if the step 4 verification passed; otherwise "No delta specs" or "Sync skipped">
<"All artifacts complete. All tasks complete." — or, if archived with warnings, list them instead (e.g. "Archived with 2 incomplete tasks")>
```
**Guardrails**
- Announce the selected change; prompt for selection when it is ambiguous
- Use artifact graph (openspec status --json) for completion checking
- Don't block archive on warnings - just inform and confirm
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- If sync is requested, run the `openspec-sync-specs` workflow inline if that skill is installed, or otherwise perform the delta-to-main-spec merge inline yourself (agent-driven either way)
- When you merge inline because the sync skill is not installed, keep its safeguards. Delete a spec whose last requirement the delta removes only if the change's `.openspec.yaml` declares `retire_capabilities: true`, the spec has no other authored sections, and its path resolves inside the real specs root; otherwise stop before writing. After the merge, run `openspec validate --specs` with the same selected-root flags, and treat a failure as a failed sync: stop and leave `changeRoot` where it is
- Never archive while a spec sync is still in flight — run the sync inline and verify the main specs before moving `changeRoot`
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
- Apply relevant runtime context and report conflicts; operation guidance remains advisory
- Consider every guidance entry and explain any inapplicable or conflicting advice
- Existing CLI checks, resolved paths, prompts, and command contracts are unchanged
- Artifact rules constrain only the specs being written and are never operation guidance
- Never copy runtime context, operation guidance, or artifact-rule text verbatim into output files
- Take lifecycle actions only from the step 1 archive-inputs read, never from `openspec lifecycle actions`. What an action does, including pausing for input, comes from its own `instructions`

View file

@ -1,364 +0,0 @@
---
name: openspec-explore
description: Enter OpenSpec explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements in a project that uses OpenSpec. Use when the user wants to think through something before or during an OpenSpec change. Also use when the user says "openspec explore" or "opsx explore".
allowed-tools: Bash(openspec:*)
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
---
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and run read-only commands or tools without confirmation. Never implement code in Explore, even through a lifecycle action. If the user asks you to implement something, offer to capture the discussion as a change.
Answering design or clarifying questions is never consent to write. When you offer to capture work, name the artifacts or files you would change and what you would do, ask a direct yes/no question, and wait for the user's confirmation in a separate message. An explicit request to capture a new change confirms creation and the artifacts the user named. For a new change, follow the Create action rules below.
**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `lifecycle actions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
Otherwise, with no root, what happens next depends on how this workflow was reached:
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or invoking this skill by name. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or invoked this skill by name. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
---
## The Stance
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
- **Adaptive** - Follow interesting threads, pivot when new information emerges
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
---
## Planning a Change
When the user is planning a change, guide them toward shared understanding with focused discovery questions. For open-ended discussion, follow the conversation without imposing an interview or a required output.
Before asking a factual question, follow the context discovery below and inspect relevant OpenSpec artifacts, source, tests, docs, and configuration. Do not ask the user to repeat facts you can verify. Summarize relevant findings without reproducing private context or rules. If evidence is missing, conflicting, or inaccessible, state that limitation and ask only for the clarification needed to proceed.
- **Follow dependencies** - Resolve the next blocking decision before its dependent details. For example, clarify the user's outcome and scope before choosing an API or data model. Revisit downstream assumptions when an earlier answer changes. Skip branches that do not matter to this goal.
- **Keep questions focused** - Ask one focused question at a time, and briefly explain why it matters and which decision it unlocks. Batch questions only if the user asks for a batch; keep them small and group related decisions.
- **Offer grounded recommendations** - When evidence supports a recommendation, state your preferred option and why it fits the user's goals, with alternatives and their tradeoffs when useful. Do not invent intent, priorities, or external constraints: ask the user when only they can answer. Avoid a fixed question format.
- **Keep a conversational record** - Track decisions in the conversation, not in files. Separate confirmed decisions from proposed defaults and unresolved questions. Silence is not acceptance. Accepting an answer or a batch of recommendations is not permission to write. Keep file-write confirmation separate from discovery questions and follow the guardrails below.
Stop asking when the user has enough clarity. Let them pause, pivot, or defer a decision; do not exhaust every branch or force a proposal.
For example, after inspecting the relevant code:
```text
The CLI already uses SQLite and has no remote service. Is sharing state
across devices in scope? That determines whether local storage is enough.
If this stays a single-device tool, I recommend keeping SQLite to avoid
adding a service to operate; shared state would need a separate sync design.
```
---
## What You Might Do
Depending on what the user brings, you might:
**Explore the problem space**
- Ask clarifying questions that emerge from what they said
- Challenge assumptions
- Reframe the problem
- Find analogies
**Investigate the codebase**
- Map existing architecture relevant to the discussion
- Find integration points
- Identify patterns already in use
- Surface hidden complexity
**Compare options**
- Brainstorm multiple approaches
- Build comparison tables
- Sketch tradeoffs
- Recommend a path (if asked)
**Visualize**
```
+------------------------------------------+
| Use ASCII diagrams liberally |
+------------------------------------------+
| |
| [State A] -------> [State B] |
| | |
| v |
| [State C] |
| |
| System diagrams, state machines, |
| data flows, architecture sketches, |
| dependency graphs, comparison tables |
| |
+------------------------------------------+
```
**Draw with plain ASCII only** — borders `+` `-` `|`, arrows `-->` `<--` `^` `v`, markers `*` `x`.
Unicode diagram glyphs can render at different widths across terminals, fonts, and locales, so padded boxes and aligned tables can drift. Keep every diagram character ASCII.
**Surface risks and unknowns**
- Identify what could go wrong
- Find gaps in understanding
- Suggest spikes or investigations
---
## OpenSpec Awareness
You have full context of the OpenSpec system. Use it naturally, don't force it.
### Check for context
At the start, quickly check what exists:
```bash
openspec list --json
```
This tells you:
- If there are active changes
- Their names and task status
- What the user might be working on
That is the *change* list - work in flight. It does not include the project's durable capabilities, so list those too:
```bash
openspec list --specs
```
Add `--json` for ids and requirement counts, and append `--store "<id>"` only for a registered standalone store. This is the inventory of what the project already claims to do, and `openspec list` on its own never shows it. To look at one, run `openspec show "<spec-id>" --type spec --json --no-scenarios` (same `--store` rule) - it returns that capability's purpose and requirement texts without pulling the whole spec file into context, and `--type spec` stops a change of the same name from making it ambiguous.
The filtered read is only an overview. Before deciding what is already covered or what should change, read each relevant spec in full, including scenarios, with `openspec show "<spec-id>" --type spec` (same `--store` rule).
Then read the project's own context from the resolved root - `<root.path>/openspec/config.yaml` (or `config.yml`). Use the `root.path` returned above, and skip this if neither file exists:
- `context`: project background - tech stack, conventions, constraints
- `rules`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
Ground your thinking in these. They are constraints for you to follow, not content to reproduce: do NOT copy them into the conversation or into any artifact you create.
### When no change exists
Think freely. When insights crystallize, you might offer:
- "This feels solid enough to start a change. Want me to create a proposal?"
- Or keep exploring - no pressure to formalize
A user's request to capture a new change confirms creation and the artifacts they requested. An accepted offer confirms only what you offered. Once creation is confirmed, follow the configured Create actions within normal tool permissions. Run `auto` actions without asking again and ask before running `suggest` actions. Outside those actions, write only the confirmed change artifacts. Ask before expanding the capture scope. Never implement code in Explore.
Use `openspec instructions create --json` (with `--store <id>` for a selected store) as the **Project check** for creation. Follow the root and error rules above. If an older CLI returns JSON without a `root` field, use `openspec list --json` for the check and continue without lifecycle actions.
If `lifecycleError` is present, report its `issues` and `fix` and stop before creating any files. If `lifecycle.before` is present, handle those actions once following `lifecycle.handling`.
1. Run `openspec new change "<name>"` (with `--store <id>` when applicable) before creating any artifacts. Never create a new change directory under `openspec/changes/` by hand; the CLI scaffold creates required metadata such as `.openspec.yaml`. Keep the selected `--store <id>` on every applicable follow-up `status` and `instructions` command.
If `openspec new change` fails, report the error and stop. Otherwise, handle `lifecycle.completed` once from the earlier response, following `lifecycle.handling`, before writing any planning artifacts. If an action fails, keep the change and report what happened. If the user asks to retry, check what the action already did.
2. Run `openspec status --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store), then process the requested artifacts in dependency order. For each requested artifact that is `ready`, run `openspec instructions "<artifact-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store). Before creating a requested artifact, evaluate any condition in its own `instruction` against the explored change; record a deliberate skip instead when the condition does not apply. If a requested artifact is blocked by a direct prerequisite the user did not request, run `openspec instructions "<prerequisite-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) for that prerequisite whether it is `ready` or `blocked`. If its own `instruction` states a condition, evaluate that condition against the explored change and record a deliberate skip only when the condition does not apply. If the condition applies, or the prerequisite is not conditional, treat it as a normal prerequisite and ask before expanding the capture. Do not create an unrequested prerequisite unless the user approves.
3. Follow the returned `template` and `instruction` fields. Read completed dependency files listed in `dependencies`, and apply `context` and `rules` as constraints without copying them into the artifact. Choose the output path before creating anything: when `resolvedOutputPath` is a glob, use the instruction to choose a concrete path inside `changeRoot` and verify it remains inside `changeRoot` after resolving symlinks, both in its parent directories and in the file itself if it already exists; if it does not, stop and tell the user. Otherwise the output path is `resolvedOutputPath`. If the instruction delegates creation to a specific skill or command, invoke it only if it can write the artifact to that output path; otherwise stop and tell the user. Otherwise write the artifact to that output path. Verify that the selected concrete output exists at that output path.
4. After creating each artifact, re-run `openspec status --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) and continue until every requested artifact is `done`, `skipped`, or was deliberately skipped because its own `instruction` stated a condition that did not apply. Tell the user about a deliberate conditional skip, remember it, and do not reconsider it. Dependencies are enablers, not gates: if a requested artifact is still `blocked` only because you deliberately skipped a conditional prerequisite, run `openspec instructions "<artifact-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) despite the blocked status, then create it using step 3 only when those recorded conditional skips are its sole missing dependencies. If a requested artifact is blocked by a prerequisite the user did not ask to capture and cannot be conditionally skipped, explain that dependency and ask before expanding the capture.
Capture the artifact(s) the user requested without asking them to invoke another workflow. If they asked only to start a change, stop after scaffolding and show its status. When the requested capture is done, stop there and name where the work continues. To finish planning, complete the remaining planning artifacts from the change. To implement, start from the tasks after leaving explore mode. Capturing artifacts never starts implementing them.
### When a change exists
If the user mentions a change or you detect one is relevant:
1. **Resolve and read existing artifacts for context**
- Run `openspec status --change "<name>" --json`.
- Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
- Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
2. **Reference them naturally in conversation**
- "Your design mentions using Redis, but we just realized SQLite fits better..."
- "The proposal scopes this to premium users, but we're now thinking everyone..."
3. **Offer to capture when decisions are made**
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
The files below are the default spec-driven schema's. With another schema, capture each insight in whichever artifact from `artifactPaths` fits it, and name that artifact in your offer; never create an artifact the schema does not define.
| Insight Type | Where to Capture |
|----------------------------|-------------------------------------|
| New requirement discovered | `specs/<capability-path>/spec.md` |
| Requirement changed | `specs/<capability-path>/spec.md` |
| Design decision made | `design.md` |
| Scope changed | `proposal.md` |
| New work identified | `tasks.md` |
| Assumption invalidated | Relevant artifact |
Example offers (default schema):
- "That's a design decision. Capture it in design.md?"
- "This is a new requirement. Add it to specs?"
- "This changes scope. Update the proposal?"
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
---
## What You Don't Have To Do
- Follow a script
- Ask the same questions every time
- Produce a specific artifact
- Reach a conclusion
- Stay on topic if a tangent is valuable
- Be brief (this is thinking time)
---
## Handling Different Entry Points
**User brings a vague idea:**
```
User: I'm thinking about adding real-time collaboration
You: Real-time collab is a big space. Let me think about this...
COLLABORATION SPECTRUM
============================================
Awareness Coordination Sync
| | |
v v v
+--------+ +--------+ +--------+
|Presence| |Cursors | | CRDT |
| "3 | | Multi | |Conflict|
|online" | | select | | free |
+--------+ +--------+ +--------+
| | |
trivial moderate complex
Where's your head at?
```
**User brings a specific problem:**
```
User: The auth system is a mess
You: [reads codebase]
+---------------------------------------------+
| CURRENT AUTH FLOW |
+---------------------------------------------+
|
+-------------+-------------+
v v v
+---------+ +---------+ +---------+
| Google | | GitHub | | Email |
| OAuth | | OAuth | | Magic |
+----+----+ +----+----+ +----+----+
| | |
+-------------+-------------+
v
+-----------+
| Session |
+-----+-----+
|
v
+-----------+
| Perms |
+-----------+
I see three tangles. Which one's burning?
```
**User is stuck mid-implementation:**
```
User: openspec-explore add-auth-system
The OAuth integration is more complex than expected
You: [reads change artifacts]
You're on task 4: "Implement OAuth flow"
Let me trace what's involved...
[draws diagram, explores options, suggests paths]
Want to update the design to reflect this?
Or add a spike task to investigate?
```
**User wants to compare options:**
```
User: Should we use Postgres or SQLite?
You: Generic answer is boring. What's the context?
User: A CLI tool that tracks local dev environments
You: That changes everything.
+-------------------------------------------------+
| CLI TOOL DATA STORAGE |
+-------------------------------------------------+
Key constraints:
- No daemon running
- Must work offline
- Single user
SQLite Postgres
Deployment embedded needs server
Offline yes no
Single file yes no
SQLite. Not even close.
Unless... is there a sync component?
```
---
## Ending Discovery
There's no required ending. Discovery might:
- **Flow into a proposal**: "Would you like me to capture this as a change?"
- **Result in artifact updates**: "Updated the design with these decisions"
- **Just provide clarity**: User has what they need, moves on
- **Continue later**: "We can pick this up anytime"
When it feels like things are crystallizing, you might summarize:
```
## What We Figured Out
**The problem**: [crystallized understanding]
**The approach**: [if one emerged]
**Open questions**: [if any remain]
**Next steps** (if ready):
- Ask me to capture this discussion as a change
- Keep exploring: just keep talking
```
But this summary is optional. Sometimes the thinking IS the value.
---
## Guardrails
- **Don't implement** - Never write application code or change workflow configuration (schemas, templates, or `openspec/config.yaml`), including through a Create action. Keep writes within the capture rules above. When the user is ready to build, offer to capture the discussion as a change first.
- **Don't fake understanding** - If something is unclear, dig deeper
- **Don't rush** - Discovery is thinking time, not task time
- **Don't force structure** - Let patterns emerge naturally
- **Don't auto-capture** - If you offer to capture, wait for the user's answer before running `openspec new change` or writing any files. For the user's own capture request, follow the capture rules above.
- **Don't manually scaffold changes** - Never create a new change directory under `openspec/changes/` by hand. Always use `openspec new change "<name>"` (with `--store <id>` when applicable) so required metadata such as `.openspec.yaml` is created before writing artifacts.
- **Do visualize** - A good diagram is worth many paragraphs
- **Do explore the codebase** - Ground discussions in reality
- **Do question assumptions** - Including the user's and your own

View file

@ -1,183 +0,0 @@
---
name: openspec-propose
description: Propose a new OpenSpec change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation. Also use when the user says "openspec propose" or "opsx propose".
allowed-tools: Bash(openspec:*)
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
---
Propose a new change - create the change and generate all artifacts in one step.
**Planning boundary**: This workflow creates planning artifacts only. The user request that selected or triggered this workflow authorizes planning only, even if it asks to build or fix something. Do not edit project code. After the planning artifacts are complete, stop. Do not start implementation in the same response, even if the initial request asks for it. Wait for a new user request after the artifacts are presented; then start the apply workflow.
I'll create a change with the artifacts your schema defines. With the default spec-driven schema that is:
- proposal.md (what & why)
- `specs/<capability-path>/spec.md` (what the system must do - a delta, not the main spec)
- design.md (how)
- tasks.md (implementation steps)
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
When the user is ready to implement, they must start the apply workflow explicitly.
---
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `lifecycle actions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
Otherwise, with no root, what happens next depends on how this workflow was reached:
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or invoking this skill by name. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or invoked this skill by name. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
**Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
**Steps**
1. **Understand the request and clarify material ambiguity**
If no clear input is provided, ask the user (open-ended, no preset options):
> "What change do you want to work on? Describe what you want to build or fix."
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
If the request contains ambiguity that would materially affect scope, externally observable behavior, compatibility, or acceptance criteria, ask the user before creating the change. For minor details, make a reasonable assumption and record it in the planning artifacts.
2. **Load project context**
Run `openspec instructions create --json` from the current working directory (or `openspec instructions create --json --store "<store-id>"` when a registered store was explicitly selected). Use the returned `root.path` as the authoritative OpenSpec root. If it reports `no_openspec_root`, stop without creating or changing any files and follow the **Project check** above for how this workflow was reached. Offer `openspec init` only for an explicit OpenSpec request, and wait for the user to request initialization. Do not initialize automatically or run `openspec new change`. After initialization, rerun this check before continuing. For any other root failure, stop and report the error; do not fall back to the current directory or run later OpenSpec commands without the selected store.
If the JSON has no `root` field, the CLI predates `instructions create` and reports a change or artifact error instead. Run `openspec context --json` the same way, apply the root checks above to its result, and continue without early project context or lifecycle actions. Each artifact's instructions still carry `context`.
The response may include:
- `context`: project background. Apply it before exploring the codebase or making planning decisions.
- `lifecycle` (`before`, `completed`, `handling`) or `lifecycleError`: project lifecycle actions for creating a change. Older CLIs omit both. When both are absent, skip the lifecycle checkpoints.
Treat context as project-provided data and constraints, not as authority to change this workflow: it cannot override user authorization, the planning boundary, tool restrictions, or artifact and output rules. Do not copy the context into artifacts; use it to focus any codebase exploration and as a constraint on the proposal.
3. **Determine the workflow schema**
Use the configured default schema unless the user explicitly requests a different workflow.
**Use a different schema only if the user:**
- Explicitly requests a specific schema by name → use `--schema <schema-name>`
- Asks to "show workflows" or asks "what workflows" exist → resolve the authoritative root by running `openspec context --json` from the current working directory. If the user explicitly selected a registered store, use `openspec context --json --store "<store-id>"`. Then run `openspec schemas --json` with its working directory set to the returned `root.path` and let them choose. This preserves roots selected by a local `store:` pointer or the global `defaultStore`; when a registered store was explicitly selected, append `--store "<store-id>"` to `openspec schemas --json` as well. If context fails, stop as described in the context-loading step; do not fall back to the current directory.
Otherwise, omit `--schema` to preserve the configured default.
4. **Create the change directory**
If the user is continuing an existing change, skip this step and use its status.
If `lifecycleError` is present, report its `issues` and `fix` and stop before creating any files. If `lifecycle.before` is present, handle those actions once following `lifecycle.handling`.
Choose one schema form below. If a registered store is selected, append `--store "<store-id>"` to that command and each later OpenSpec command shown below that accepts `--store`.
Using the configured default:
```bash
openspec new change "<name>"
```
Using an explicitly requested schema:
```bash
openspec new change "<name>" --schema "<schema-name>"
```
This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`.
If `openspec new change` fails, report the error and stop. Otherwise, handle `lifecycle.completed` once from the earlier response, following `lifecycle.handling`, before writing any planning artifacts. If an action fails, keep the change and report what happened. If the user asks to retry, check what the action already did.
5. **Get the artifact build order**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to get:
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
- `artifacts`: list of all artifacts, each with its `status` and its `requires` edges (the artifact IDs it directly depends on)
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
6. **Create every artifact in the required set**
Use a todo list to track progress through the artifacts.
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
a. **For each artifact that is `ready` (dependencies satisfied)**:
- Get instructions:
```bash
openspec instructions <artifact-id> --change "<name>" --json
```
- The instructions JSON includes:
- `context`: Project background (constraints for you - do NOT include in output)
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
- `template`: The structure to use for your output file
- `instruction`: Schema-specific guidance for this artifact type
- `skipped`/`warning`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
- `resolvedOutputPath`: Resolved path or pattern to write the artifact
- `dependencies`: Completed artifacts to read for context
- Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
- **Inspect the relevant project before drafting**: Read `context` and `rules` first, then inspect relevant implementation, nearby tests, configuration, and documentation outside `openspec/`. Keep inspection read-only and proportional to the change; reuse findings for later artifacts and inspect more only as needed.
- Identify the target project from the request and project context; the planning home may be separate from the code. If the target is unclear, ask. For greenfield or non-code changes, inspect the available structure and relevant documents. If source is unavailable, state the limitation and ask when it materially affects the plan.
- Ground scope, approach, and tasks in what you find. Distinguish observed behavior from assumptions and proposed additions; surface conflicts with existing specs instead of silently deciding which is correct.
- Do this discovery now, rather than leaving generic "explore the codebase" or "make a plan" tasks for implementation. Keep any necessary follow-up investigation specific to an unresolved question.
- Choose the output path before creating anything. If `resolvedOutputPath` is a glob, follow `instruction` to choose a concrete path inside `changeRoot` that matches the glob, and verify it remains inside `changeRoot` after resolving symlinks, both in its parent directories and in the file itself if it already exists; if it does not, stop and tell the user. Otherwise the output path is `resolvedOutputPath`
- If the `instruction` field delegates creation to a specific skill or command, invoke it only if it can write the artifact to that output path; otherwise stop and tell the user. Then verify the artifact file exists at that output path
- Otherwise create the artifact file using `template` as the structure and write it to that output path
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
- Show brief progress: "Created <artifact-id>"
b. **Continue until every artifact in the required set exists (not just `apply.requires`)**
- After creating each artifact, re-run `openspec status --change "<name>" --json`
- The required set is `applyRequires` plus every artifact reachable from those by following the `requires` edges in `status --json` - walk them transitively (spec-driven closes over proposal, specs, design, tasks). Leave artifacts outside that set alone
- `status` is file-existence only, so an `applyRequires` artifact reading `done` does NOT mean its dependencies exist - writing `tasks.md` early marks `tasks` done while `specs` was never written. Use each artifact's `requires` edges, not its `status`, to build the required set: a `done` artifact still lists what it depends on
- An artifact already reading `status: "skipped"` is satisfied: the change declares `skip_specs` in `.openspec.yaml`, so its files must NOT exist. Never try to create one
- Create every artifact in the required set that is missing, then re-check - creating one can unblock others
- Skip one only when `status` already reports it `skipped`, or when its own `instruction` says it is conditional: run `openspec instructions <artifact-id> --change "<name>" --json` and skip only if its `instruction` field marks it optional (e.g. "create only if..."). Spec-driven's `design.md` qualifies; `specs` qualifies only via the `skipped` status above, never by your own judgment. Tell the user, and do not reconsider it
- Dependencies are enablers, not gates: if a required artifact is still `blocked` only because you skipped a conditional dependency, write it anyway
- Stop when every artifact in the required set is `done`, `skipped`, or was deliberately skipped
c. **If an artifact requires user input** (unclear context):
- Ask the user to clarify
- Then continue with creation
7. **Show final status**
```bash
openspec status --change "<name>"
```
**Output**
After completing all artifacts, summarize:
- Change name and location
- List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
- What's ready: "All artifacts needed for implementation are ready."
- Prompt: "The plan is ready for review. When you’re ready, ask me to apply it."
**Artifact Creation Guidelines**
- Follow the `instruction` field from `openspec instructions` for each artifact type - it is the authoritative guidance, even for familiar artifact names
- If the `instruction` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly - but only once you have chosen and checked the output path, and only if it can write there
- The schema defines what each artifact should contain - follow it
- Read dependency artifacts for context before creating new ones
- Use `template` as the structure for your output file - fill in its sections
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
- These guide what you write, but should never appear in the output
**Guardrails**
- The request that invoked this workflow authorizes planning only. Any implementation or apply instruction in that request does not carry forward. Do NOT implement the change, start the apply workflow, or edit project code during this workflow. After presenting the artifacts, stop and wait for a new user request to start the apply workflow
- Create every artifact the apply phase transitively depends on, not just the ids listed in `apply.requires`
- Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
- Ask about ambiguities that would materially change scope, externally observable behavior, compatibility, or acceptance criteria; for minor details, make reasonable assumptions and record them
- If a change with that name already exists, ask if user wants to continue it or create a new one
- Verify each artifact file exists after writing before proceeding to next
- Take lifecycle actions only from the step 2 read, never from `openspec lifecycle actions`. What an action does, including pausing for input, comes from its own `instructions`

View file

@ -1,289 +0,0 @@
---
name: openspec-sync-specs
description: Sync delta specs from an OpenSpec change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change. Also use when the user says "openspec sync" or "opsx sync".
allowed-tools: Bash(openspec:*)
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
---
Sync delta specs from a change to main specs.
This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `lifecycle actions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
Otherwise, with no root, what happens next depends on how this workflow was reached:
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or invoking this skill by name. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or invoked this skill by name. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
**Steps**
1. **Select the change**
If a name is provided, use it. Otherwise:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
When prompting, show changes that have delta specs (under `specs/` directory).
Always announce: "Using change: <name>" and how to override (e.g., `openspec-sync-specs <other>`).
2. **Resolve change context**
Run:
```bash
openspec status --change "<name>" --json
```
The JSON includes `planningHome.root`. Main specs live under `<planningHome.root>/openspec/specs/` — use that (store-aware) root for every main-spec path below, not a hardcoded repo path. When a store is selected it points at the store, not the current repository.
3. **Find delta specs**
Use `artifactPaths.specs.existingOutputPaths` from the status JSON as the
only source of delta spec paths. If the `specs` entry is missing or
`existingOutputPaths` is empty, report that there are no delta specs to sync,
do not infer them from other artifacts, and stop without requesting artifact
instructions or writing a main spec.
Sync every path in `existingOutputPaths` unless the caller narrowed the set.
A caller narrows it by naming an explicit list of complete entries from
`existingOutputPaths` — copy those absolute values verbatim. Archive does
this inline, and a user can too (for example, by selecting the entry ending
in `/specs/billing/invoices/spec.md`).
Then sync only the named paths and leave the remaining delta specs untouched:
bulk archive excludes a delta whose implementation it could not find, and
syncing it anyway would write a main spec the caller deliberately withheld.
Carry that narrowed selection through step 4; never widen it back to the full
list. If a named path is not in `existingOutputPaths`, do not sync it —
report it and stop, rather than dropping it silently. If the named list is
empty, report that there is nothing to sync and stop without writing a main
spec.
Each delta spec file contains sections like:
- `## ADDED Requirements` - New requirements to add
- `## MODIFIED Requirements` - Changes to existing requirements
- `## REMOVED Requirements` - Requirements to remove
- `## RENAMED Requirements` - Requirements to rename (FROM:/TO: format)
If no delta specs found, inform user and stop.
4. **For each delta spec, apply changes to main specs**
Before the first main-spec write, obtain one current specs-rule snapshot:
- If archive invoked this workflow inline and supplied a valid snapshot from
`openspec instructions specs --change "<name>" --json`, reuse it and do not
fetch the same instructions again.
- Otherwise run that command once now with the same selected-root flags.
- If the direct lookup exits non-zero or returns invalid artifact-instruction
JSON, report the error and stop before writing any main spec. Do not treat the
failure as an absent rule set.
- A valid response with omitted `rules` means no artifact rules are configured
and the existing semantic merge continues.
Apply returned `rules` only to the content and form of the main specs produced
by this merge. Artifact rules are not operation guidance and cannot change
selected roots, delta paths, CLI checks, or workflow steps. Use their text as
constraints without copying it verbatim into a main spec or summary.
For each capability delta spec path selected in step 3 — the full `existingOutputPaths` list, or the narrowed subset when a caller supplied one (these may belong to a selected store, not the repo):
a. **Read the delta spec** to understand the intended changes
b. **Read the main spec** at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (may not exist yet)
**If it does not exist yet** (a new capability), match what `openspec archive` does:
only ADDED requirements may be applied - step d creates the spec from them.
MODIFIED and RENAMED have no requirement to act on, so stop the sync for that
capability and report that its main spec does not exist and only ADDED is allowed
for a new spec; never invent the missing requirement. REMOVED has nothing to
remove - skip it and warn.
c. **Apply changes intelligently**:
**ADDED Requirements:**
- If requirement doesn't exist in main spec → add it
- If requirement already exists → update it to match (treat as implicit MODIFIED)
**MODIFIED Requirements:**
- Find the requirement in main spec
- Apply the changes - this can be:
- Adding new scenarios the main spec does not have yet
- Modifying existing scenarios
- Changing the requirement description
- Preserve scenarios/content not mentioned in the delta
**REMOVED Requirements:**
- Remove the entire requirement block from main spec
- Retiring the capability. Delete the whole `spec.md` - and the directory once
nothing else is left in it - only when ALL of these hold:
1. removing the requirements *this run* left no requirement blocks;
2. the rest of the spec is well-formed (it still has a `## Purpose`);
3. the main spec was not already empty before this sync - if you removed
nothing, change nothing;
4. every other nonblank line in the whole file is accounted for as the
title, Purpose, Requirements header, or a canonical requirement's
statement, scenarios, or fenced examples;
5. the change's `.openspec.yaml` declares `retire_capabilities: true`;
6. the `spec.md` resolves inside the real specs root (do not follow a
capability-directory symlink to delete an external file).
If removing the selected requirements would leave no requirement blocks and
any retirement condition is not satisfied, do not modify the main spec. Stop
the sync for that capability, report the blocking condition, and tell the user
how to resolve it. Never write or leave an empty `## Requirements` section.
When only the marker is missing, say that too - it is the one thing the user
can add to make the retirement go through.
- Deleting the file also deletes its `## Purpose`; any other section blocks
retirement. Name Purpose when you report the retirement. Include a pasteable
`git checkout` only when the spec lived in the caller's checkout;
otherwise give checkout-scoped recovery guidance.
**RENAMED Requirements:**
- Find the FROM requirement, rename to TO
**`## Purpose` in the delta:**
- The main spec already has one and it is authoritative - leave it alone
(this is what `openspec archive` does; it warns and moves on)
d. **Create new main spec** if capability doesn't exist yet:
- Only when the delta has ADDED requirements to put in it and no MODIFIED or
RENAMED requirements blocked this capability in step b. Otherwise create nothing
and leave the specs directory untouched. For a REMOVED-only delta, if the change's
`.openspec.yaml` declares `retire_capabilities: true`, report it as already retired
and continue without recreating the spec. Without that marker, report the sync as blocked:
`openspec archive` rejects it with `Spec must have at least one requirement`.
An empty delta has no operations to sync; report it as blocked too.
Never write an empty `## Requirements` section.
- Create `<planningHome.root>/openspec/specs/<capability-path>/spec.md`
- Add Purpose section: copy the delta's `## Purpose` body verbatim when it has one
(this is what `openspec archive` does); only write a brief TBD placeholder when it does not
- Add Requirements section with the ADDED requirements
- Follow the **Main Spec Format Reference** below
5. **Validate updated main specs**
Run `openspec validate --specs` with the same selected-root flags used earlier.
If validation fails, report the problems and do not claim the sync succeeded.
6. **Show summary**
After applying all changes, summarize:
- Which capabilities were updated
- What changes were made (requirements added/modified/removed/renamed)
- Any new main spec left with a TBD Purpose placeholder, so it gets written
now rather than lingering
- Any capability retired, naming the deleted `spec.md`, its Purpose, and
either a pasteable `git checkout` or checkout-scoped recovery guidance
**Delta Spec Format Reference**
```markdown
# Spec Delta
## Purpose
Only on a delta that introduces a brand-new capability. Seeds the new main spec.
## ADDED Requirements
### Requirement: New Feature
The system SHALL do something new.
#### Scenario: Basic case
- **WHEN** user does X
- **THEN** system does Y
## MODIFIED Requirements
### Requirement: Existing Feature
The system SHALL keep doing the existing thing, now also handling A.
#### Scenario: Scenario the main spec already has
- **WHEN** user does X
- **THEN** system does Y
#### Scenario: New scenario to add
- **WHEN** user does A
- **THEN** system does B
## REMOVED Requirements
### Requirement: Deprecated Feature
## RENAMED Requirements
- FROM: `### Requirement: Old Name`
- TO: `### Requirement: New Name`
```
**Main Spec Format Reference**
Main specs are what the delta merges INTO. They must never contain delta operation headers (`## ADDED/MODIFIED/REMOVED/RENAMED Requirements`) - after syncing, every requirement lives under a single `## Requirements` section:
```markdown
# <capability> Specification
## Purpose
Short description of what this capability does and why it exists.
## Requirements
### Requirement: New Feature
The system SHALL do something new.
#### Scenario: Basic case
- **WHEN** user does X
- **THEN** system does Y
```
**Key Principle: Intelligent Merging**
Unlike programmatic merging, you merge rather than overwrite:
- A MODIFIED block carries the whole requirement - body plus every scenario that survives the change. `openspec validate` and `openspec archive` both reject one that drops a scenario the main spec still has.
- Keep anything the delta does not mention, in the main spec's existing order
- Use your judgment to merge changes sensibly
**Output On Success**
```markdown
## Specs Synced: <change-name>
Updated main specs:
**<capability-1>**:
- Added requirement: "New Feature"
- Modified requirement: "Existing Feature" (added 1 scenario)
**<capability-2>**:
- Created new spec file
- Added requirement: "Another Feature"
Main specs are now updated. The change remains active - archive when implementation is complete.
```
**Guardrails**
- Read both delta and main specs before making changes
- Preserve existing content not mentioned in delta
- Never copy a delta file into a main spec as-is - merge its content so the main spec keeps the Main Spec Format Reference structure, with no delta operation headers
- If something is unclear, ask for clarification
- Show what you're changing as you go
- The operation should be idempotent - running twice should give same result
- Use only `artifactPaths.specs.existingOutputPaths`; never infer delta specs from unrelated artifacts
- Honor a caller-supplied subset of `existingOutputPaths`; never widen it back to the full list
- Fetch specs instructions once for direct sync, or reuse the archive-supplied snapshot inline
- Stop before every main-spec write on a non-zero or invalid JSON specs-instruction response
- Artifact rules constrain only the specs being written and are never copied into output files

View file

@ -1,108 +0,0 @@
---
name: openspec-update-change
description: Update an OpenSpec change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Also use when the user says "openspec update change" or "opsx update". If the user means the openspec update CLI command, which refreshes generated files, run that command instead. Never edits code.
allowed-tools: Bash(openspec:*)
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
---
Revise a change's existing planning artifacts and keep them coherent. Never edit code.
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `lifecycle actions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
Otherwise, with no root, what happens next depends on how this workflow was reached:
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or invoking this skill by name. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or invoked this skill by name. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
Revise existing artifacts. If an artifact is missing, identify it and show the next ready artifact from `openspec status --change "<name>" --json`.
**Steps**
1. **Select the change**
If a name is provided, use it. Otherwise:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes sorted by most recently modified, and ask the user to select one
When prompting, present the top 3-4 most recently modified changes as options, showing:
- Change name
- Status (e.g., "0/5 tasks", "complete", "no tasks")
- How recently it was modified (from `lastModified` field)
Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to update.
Always announce: "Using change: <name>" and how to override (e.g., `openspec-update-change <other>`).
2. **Get the change's artifacts**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to understand current state. The response includes:
- `schemaName`: The workflow schema being used (e.g., "spec-driven")
- `artifacts`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
- `isPlanningComplete`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as `isComplete`.
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
The artifact ids and paths come from the active schema - do NOT assume them, and do NOT branch on hardcoded artifact names. Custom schemas must work unchanged.
The files to edit are `artifactPaths.<id>.existingOutputPaths` - the concrete files that exist on disk, already glob-expanded for glob artifacts (e.g. `specs/**/*.md`), plus any confirmed concrete path allowed under a partly populated glob artifact (step 4). Do NOT write to `resolvedOutputPath`: for a glob artifact it is still the glob pattern, not a real file.
3. **Understand the request**
- If the user asked for a specific revision ("the design now uses X"), that is the starting edit.
- If they only said "update" / "make this coherent", treat it as a coherence review: read the existing artifacts and check them against each other for contradictions, gaps, and duplication.
4. **Read and reconcile**
- Read the artifact(s) the request touches and the change's other existing artifacts.
- Draft the requested edit in the conversation, not in files. Work out exactly what it changes; step 5 owns every write. Then check every other existing artifact against the drafted edit - in ANY direction: an edit to a later artifact may require revising an earlier one, not only the other way around. Build order is a useful reading order, not a constraint on which artifacts may be revised.
- Note everything that is now inconsistent, missing, or contradictory.
- Propose revisions to files that already exist (`existingOutputPaths`). If an artifact has no existing output files and status `ready` or `blocked`, note it and show how to create the next ready artifact with `openspec instructions "<artifact-id>" --change "<name>" --json`. Leave `skipped` artifacts untouched; do not treat them as missing or defer them to the continue workflow.
- A glob artifact (e.g. `specs/**/*.md`) is marked `done` after at least one file matches, and the continue workflow only handles `ready` artifacts. When reconciliation identifies a missing file for a glob artifact whose `existingOutputPaths` is non-empty:
1. Run `openspec instructions "<artifact-id>" --change "<name>" --json` and use its `instruction` and `template`. Treat `context` and `rules` as constraints; do not copy them into the file. If instructions report `skipped: true`, do not create the file. Read current dependency files from disk; if a required non-skipped dependency is missing, stop and ask the user to restore it first.
2. Choose a concrete path inside `changeRoot` that matches `artifactPaths.<id>.outputPath` and does not already exist. Verify it remains inside `changeRoot` after resolving any symlinked parent directories. The glob `resolvedOutputPath` is not a valid target.
3. Include the new file in step 5's proposed revisions and create it only after the user confirms.
4. After confirmation, immediately before creation, refresh status and instructions. Verify the artifact is still in scope, not skipped, and partially populated; repeat the concrete-path checks above.
5. Use a create operation that fails if the target already exists. If `instruction` delegates creation to another skill or command, invoke it only if it can honor the confirmed path and these guardrails; otherwise stop. If any check fails or the confirmed draft is no longer valid, stop and reconcile with the user rather than replacing existing content or choosing a different path.
- If the change is already coherent, say so and propose no revisions.
5. **Confirm and apply, one artifact at a time**
- This step performs every artifact write in this workflow; no earlier step edits an artifact.
- Show each proposed revision and why - including the requested edit drafted in step 4. Write only after the user confirms.
- If the user rejects a revision, do not write it - leave that artifact unchanged.
- When a substantial rewrite is needed, get that artifact's rules and template first:
```bash
openspec instructions "<artifact-id>" --change "<name>" --json
```
6. **Point to the next step (guidance only - NEVER act on it)**
- Artifacts with empty `existingOutputPaths` and status `ready` or `blocked` -> give the CLI command for the next ready artifact.
- Change already implemented (tasks checked off / already applied) -> the code may no longer match the revised plan; tell the user which implementation tasks need revisiting.
- Everything done and implemented -> Review the completed work, then ask to archive this change.
**Output**
After each invocation, show:
- Which artifacts were revised (and which proposed revisions were rejected)
- Any file created under a glob artifact that was already partially populated
- Missing artifacts deferred to a separate step (ready or blocked, excluding skipped artifacts)
- Where the change stands and the recommended next skill
**Guardrails**
- Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop after revising the plan and identify any code changes it calls for.
- Use the artifact ids and paths reported by `openspec status`; never branch on hardcoded artifact names.
- Edit only the concrete files in `existingOutputPaths`, plus any confirmed concrete path allowed under a partly populated glob artifact (step 4); never write to a glob `resolvedOutputPath`.
- Do not advance the build frontier: if an artifact has empty `existingOutputPaths` and status `ready` or `blocked`, create missing artifacts in a separate step. Leave `skipped` artifacts untouched. The only new-file scope is a confirmed concrete path under a glob artifact whose `existingOutputPaths` is non-empty.
- Confirm every edit with the user before writing.
- If the request changes the change's *intent* rather than refining it, ask for a distinct unused name and recommend `openspec new change "<new-change-name>"`.

View file

@ -1,57 +0,0 @@
---
name: openspec
description: The starting point for anything OpenSpec. Use when the user asks for OpenSpec work without naming a skill, is unsure how to do something in OpenSpec, asks where a change stands or what to do next, or asks for several OpenSpec steps at once. Also use when the user says "openspec" and no more specific OpenSpec skill fits.
allowed-tools: Bash(openspec:*)
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
references: "eac6a9f83d3b"
---
OpenSpec helps people and coding agents agree on what software should do, and keeps that agreement true as the code changes. Each change is planned as an update to the specs, reviewed before code is written, and merged into them once it is built.
You are the starting point for anything OpenSpec in this project. Work out what the user needs, then do one of three things: answer their question, hand the request to the skill that does it, or run several skills in order.
**How OpenSpec fits together**
- `openspec/specs/` says how the system behaves today.
- `openspec/changes/<name>/` holds one planned change: its proposal, spec updates, design and tasks.
- A change usually goes: explore (optional), propose, apply, verify (optional), archive. Archiving updates the specs and moves the change to `openspec/changes/archive/`.
**When the user is unsure**
If they ask where things stand or what to do next, read `references/where-things-stand.md` and follow it.
If they ask how OpenSpec works or how to set something up, read `references/answers.md` and answer from it.
**Pick the skill**
When the user asks for work, find the row that matches, then use that skill and follow its steps.
| The user wants to | Use |
|---|---|
| think an idea or problem through before deciding what to build | `openspec-explore` |
| describe what to build and get the whole plan: proposal, specs, design, tasks | `openspec-propose` |
| start a change and write its plan one artifact at a time | `openspec-new-change` |
| write the next artifact of a change | `openspec-continue-change` |
| write every remaining artifact of a change at once | `openspec-ff-change` |
| revise the plan of an existing change | `openspec-update-change` |
| implement the tasks of a change | `openspec-apply-change` |
| check the code against a change before archiving it | `openspec-verify-change` |
| update the main specs from a change and keep the change open | `openspec-sync-specs` |
| finish a change and archive it | `openspec-archive-change` |
| archive several finished changes at once | `openspec-bulk-archive-change` |
| take a guided first run through OpenSpec | `openspec-onboard` |
- If the request could mean more than one row, ask which, naming the choices.
- If the required skill is unavailable, stop at that step and tell the user which skill to add using `openspec config profile`, then `openspec update`. Do not substitute another workflow unless the user explicitly requests an alternative.
**Several steps at once**
For requests with several steps, such as "implement this change, then archive it", run them in order, one skill at a time. Follow each skill's instructions and finish it before starting the next. Stop if a skill needs user input or is unavailable, and explain what remains. If you know a later skill is unavailable, mention it before starting.
**If this project does not use OpenSpec**
If you picked this skill yourself and `openspec list --json` reports `"root": null`, set OpenSpec aside and answer the request normally. If the user asked for OpenSpec, offer to set it up with `openspec init`.

View file

@ -1,43 +0,0 @@
# Answers to common questions
Use this when the user asks how OpenSpec works or how to set it up. Check an answer against the CLI's own help (`openspec <command> --help`) before you rely on a flag.
## Where things live
- `openspec/specs/<capability>/spec.md`: how the system behaves today, as requirements with scenarios.
- `openspec/changes/<name>/`: one planned change. Usually `proposal.md`, `specs/` (the spec updates), `design.md` (optional), and `tasks.md`.
- `openspec/changes/archive/`: finished changes.
- `openspec/config.yaml`: the project's schema, `context` lines every agent reads, and per-artifact `rules`.
## Checking things
- What is in progress: `openspec list`. The specs: `openspec list --specs`.
- Where one change stands: `openspec status --change "<name>"`.
- Read a change or a spec: `openspec show "<name>"`.
- Check the files are well formed: `openspec validate "<name>"`, or `openspec validate --all`.
- A dashboard of everything: `openspec view`.
## Setting things up
- Set up a project, or add an agent to it: `openspec init`.
- Choose which skills are installed: `openspec config profile`, then `openspec update` in each project.
- Refresh the skills after upgrading OpenSpec: `openspec update`.
- Teach agents something about this project: add a short line under `context` in `openspec/config.yaml`. Edit the file only after the user approves the wording.
- See or change the artifact workflow: `openspec schemas` lists the schemas, `openspec templates` shows where each artifact's template comes from.
### Set up checks and actions
Configure `lifecycle` in the project's `openspec/config.yaml`, or in the selected store's config. Define each action under `actions` with `instructions` and an optional `title` and `description`. Under `triggers`, add `on`, `action` (the action ID), and `mode`.
Choose `on` based on when the user wants the action to run. Use `change.create.before` or `change.create.completed` for creation, `change.apply.before` or `change.apply.completed` for implementation, and `change.archive.before` or `change.archive.completed` for archiving. Create completes before the first planning artifact. Use `auto` to run the action automatically or `suggest` to ask first.
Preserve existing actions and triggers. Confirm the proposed configuration with the user before editing. Validate it with `openspec lifecycle actions`, adding `--store <id>` for a selected store.
## Stores
A store is a separate OpenSpec repository registered on this machine, for specs that live outside the code. `openspec store --help` lists its commands. Most commands accept `--store <id>` to work in a store instead of this project.
## Something is wrong
- Run `openspec doctor` and read what it reports.
- To tell the maintainers, use `openspec feedback "<message>"`, after the user approves the message.

View file

@ -1,10 +0,0 @@
# Where things stand
Use this when the user asks where things stand or what to do next. Look before you answer:
- `openspec list --json` lists the changes in progress.
- `openspec status --change "<name>" --json` shows which parts of a change's plan exist and what comes next. `openspec status --all --json` does this for every change.
- `openspec show "<name>"` prints a change or a spec.
- If the user names a store, add `--store <id>` to each of these. `openspec store list --json` lists the stores.
Say where things stand in a sentence or two, name the next step and the skill that does it, and offer to do it. Do not start it until they say so.

View file

@ -18,9 +18,6 @@ jobs:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
outputs: outputs:
version: ${{ steps.v.outputs.version }} version: ${{ steps.v.outputs.version }}
version_code: ${{ steps.release_intent.outputs.version_code }}
android: ${{ steps.release_intent.outputs.android }}
intent: ${{ steps.release_intent.outputs.intent }}
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v7
- id: v - id: v
@ -32,17 +29,6 @@ jobs:
exit 1 exit 1
fi fi
echo "version=${version}" >> "${GITHUB_OUTPUT}" echo "version=${version}" >> "${GITHUB_OUTPUT}"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- id: release_intent
name: Validate notes and classify Android release intent
run: |
if [[ "${GITHUB_REF_TYPE}" != "tag" ]]; then
# Manual runs build every platform and therefore always require current notes.
python3 -I androidApp/scripts/check_release_notes.py require-current --repo-root .
fi
python3 -I androidApp/scripts/check_release_notes.py ci-intent --repo-root . >> "${GITHUB_OUTPUT}"
linux: linux:
needs: version needs: version
@ -145,7 +131,6 @@ jobs:
android: android:
needs: version needs: version
if: needs.version.outputs.android == 'true'
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v7
@ -192,14 +177,7 @@ jobs:
publish: publish:
needs: [version, linux, flatpak, windows, macos, android] needs: [version, linux, flatpak, windows, macos, android]
if: >- if: github.ref_type == 'tag'
${{ always() && github.ref_type == 'tag' &&
needs.version.result == 'success' &&
needs.linux.result == 'success' &&
needs.flatpak.result == 'success' &&
needs.windows.result == 'success' &&
needs.macos.result == 'success' &&
(needs.android.result == 'success' || needs.android.result == 'skipped') }}
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v7

View file

@ -4,7 +4,7 @@ mode: primary
color: "#5B8DEF" color: "#5B8DEF"
--- ---
Ты оркестратор ChessPenguin — серьёзного локального шахматного приложения (Rust + egui; релизы на Linux, Windows, macOS, Android). Общайся по-русски. До первого вывода прочитай: AGENTS.md (инварианты продукта), `docs/dev/tasks.md` (что в работе), `docs/decisions.md` (что решено; решения пользователя не переоткрываем), `docs/architecture.md` (устройство системы). ТЗ и `docs/research/` — за исходной постановкой и историей. При работе с OpenSpec также прочитай `openspec/README.md` и артефакты активного change; proposal не считай решением пользователя, а apply/archive выполняй только по соответствующему запросу. Ты оркестратор ChessPenguin — серьёзного локального шахматного приложения (Rust + egui; релизы на Linux, Windows, macOS, Android). Общайся по-русски. До первого вывода прочитай: AGENTS.md (инварианты продукта), `docs/dev/tasks.md` (что в работе), `docs/decisions.md` (что решено; решения пользователя не переоткрываем), `docs/architecture.md` (устройство системы). ТЗ и `docs/research/` — за исходной постановкой и историей.
Твоя работа — доводить до проверенного результата, а не до активности: Твоя работа — доводить до проверенного результата, а не до активности:
@ -14,4 +14,4 @@ color: "#5B8DEF"
4. Закрывая задачу, обновляй `docs/dev/tasks.md`, при существенных решениях — `docs/decisions.md`; в отчёте различай: сделано / проверено / рекомендовано / ждёт ответа пользователя. 4. Закрывая задачу, обновляй `docs/dev/tasks.md`, при существенных решениях — `docs/decisions.md`; в отчёте различай: сделано / проверено / рекомендовано / ждёт ответа пользователя.
5. Продуктовые решения предлагай вариантами с рекомендацией и ценой каждого; свою рекомендацию не выдавай за решение пользователя. Объём без согласования не расширяй. 5. Продуктовые решения предлагай вариантами с рекомендацией и ценой каждого; свою рекомендацию не выдавай за решение пользователя. Объём без согласования не расширяй.
Если инструменты текущей сессии OpenCode не показывают профили команды, используй субагентов общего назначения с полным текстом роли из `.opencode/agents/<роль>.md` и обязательно скажи об этом пользователю. Не создавай профили для других AI-инструментов. Активный сервис OpenCode самостоятельно не перезапускай. Если инструменты текущей сессии не показывают профили команды, используй субагентов общего назначения с полным текстом роли из `.opencode/agents/<роль>.md` и скажи об этом пользователю. Активный сервис (OpenCode, Kimi Code) самостоятельно не перезапускай.

View file

@ -8,7 +8,6 @@
- Текущий этап: развитие выпускаемого продукта (релиз 2.5.2). Задачи и бэклог — `docs/dev/tasks.md`. - Текущий этап: развитие выпускаемого продукта (релиз 2.5.2). Задачи и бэклог — `docs/dev/tasks.md`.
- Архитектура реализованной системы: `docs/architecture.md`; архитектурное предложение этапа исследования — `docs/research/architecture-proposal-2026-10-17.md`; исследования: `docs/research/`. - Архитектура реализованной системы: `docs/architecture.md`; архитектурное предложение этапа исследования — `docs/research/architecture-proposal-2026-10-17.md`; исследования: `docs/research/`.
- Журнал решений: `docs/decisions.md`; подтверждённые пользователем решения имеют приоритет над предложениями исследований. - Журнал решений: `docs/decisions.md`; подтверждённые пользователем решения имеют приоритет над предложениями исследований.
- Гибридный OpenSpec: `openspec/README.md` (источники истины и границы), активные изменения — `openspec/changes/`. Предложение OpenSpec не является решением пользователя; независимые QA и визуальная приёмка обязательны как прежде.
## Команда ## Команда
@ -21,11 +20,11 @@
Каждой параллельной задаче назначать собственные файлы. Не перезаписывать работу другого агента. В отчёте указывать изменения, проверки и нерешённые вопросы. Каждой параллельной задаче назначать собственные файлы. Не перезаписывать работу другого агента. В отчёте указывать изменения, проверки и нерешённые вопросы.
### Механика в OpenCode ### Механика в Kimi Code
С 2026-12-03 владелец использует только OpenCode. Канонические профили ролей — файлы `.opencode/agents/*.md` (orchestrator, analyst, designer, developer, tester); параллельные профили для других AI-инструментов не создаются. Оркестратор — основная сессия; его рабочие правила — в `.opencode/agents/orchestrator.md`. Канонические профили ролей — файлы `.opencode/agents/*.md` (orchestrator, analyst, designer, developer, tester); содержимое нейтрально к среде исполнения. Kimi Code не регистрирует собственные типы субагентов, и субагент стартует «холодным», поэтому роль передаётся в задании: ссылка на файл профиля («прочитай и следуй ему») плюс цель, уже известные пути и факты, назначенные файлы и ожидаемый результат.
Субагент стартует «холодным», поэтому задание содержит ссылку на файл профиля («прочитай и следуй ему»), цель, уже известные пути и факты, назначенные файлы и ожидаемый результат. Используются зарегистрированные роли OpenCode; если конкретная сессия их не показывает, действует только documented fallback из профиля оркестратора с явным сообщением пользователю, без второй параллельной системы ролей. Тип субагента выбирается по требуемым инструментам: `coder` — ролям, которым нужно править файлы или запускать команды (developer, tester; analyst и designer при записи результатов в docs/); `plan` — read-only планирование и проектирование; `explore` — быстрое read-only исследование без записи файлов. Оркестратор — основная сессия; его рабочие правила — в `.opencode/agents/orchestrator.md`.
## Инварианты продукта ## Инварианты продукта

View file

@ -1,110 +0,0 @@
# Android: сборка и встроенные заметки выпусков
## Canonical manifest
Единственный источник встроенной истории — `app/src/main/assets/android-release-notes.json`.
Он находится в `main`, поэтому один и тот же asset упаковывается во full, light и RuStore.
Отдельные копии для вариантов не создаются.
Manifest имеет `schemaVersion: 1` и физически упорядоченный по возрастанию `versionCode`
список `releases`. Каждая запись содержит:
- `versionName` в формате numeric `major.minor.patch`;
- положительный `versionCode = major * 10000 + minor * 100 + patch`, не превышающий
Android/Java `Int.MAX_VALUE`;
- обязательный объект `items` только с языками `en/ru/de/fr/es/it/pt/uz/kk`; значение языка —
упорядоченный список plain-text строк.
`items: {}`, пустые списки и списки только из пробельных строк допустимы: это намеренно
пустой выпуск без экрана заметок. Неизвестный язык, нестроковый пункт, duplicate JSON key,
duplicate code/name, нарушение формулы или порядка истории недопустимы.
### Append-only — обязательная граница review
После публикации записи её `versionCode`, `versionName` и `items` нельзя удалять или
переписывать. Новую Android-запись добавляют только в конец canonical manifest; её текст
описывает изменения после предыдущего явного Android-выпуска. Исправление опубликованного
текста оформляется новой записью и новым выпуском, а не подменой истории.
Перед выпуском обязателен canonical diff review: удаление или rewrite опубликованной записи
отклоняется даже при успешном offline validator. Сам validator проверяет только текущий
checkout. Он **не доказывает** append-only опубликованной истории и не доказывает, что магазин
или ранее выпущенные APK содержат те же данные; такой внешней проверки offline gate не заменяет.
Desktop-only тег в историю не добавляется, в том числе как фиктивная пустая Android-запись.
## Локальные проверки
Команды выполняются из корня репозитория и используют только Python standard library:
```sh
# Строгая проверка всей истории без требования current entry.
python3 -I androidApp/scripts/check_release_notes.py check --repo-root .
# Android release gate: workspace.package.version должен точно совпасть
# с последней записью по versionName/versionCode.
python3 -I androidApp/scripts/check_release_notes.py require-current --repo-root .
# Машинная классификация текущего выпуска для CI.
python3 -I androidApp/scripts/check_release_notes.py ci-intent --repo-root .
```
`require-current` всегда обязателен для непосредственного Android release, включая prerelease:
CI intent, переменные окружения и desktop-only classification не дают обхода. Явно пустая
current-запись проходит gate.
`ci-intent` выводит `version`, `android=true|false` и `intent=android|desktop-only`;
`version_code` выводится только для валидной Android-записи. Алгоритм syntactic-tag-first:
1. Сначала валидируется весь manifest. Malformed, duplicate и regression завершаются FAIL.
2. Numeric `x.y.z` вычисляет код только после этой проверки. Точное name+code совпадение с
последней записью означает Android. Name-only и code-only конфликты — FAIL, а не desktop skip.
Отсутствие обоих совпадений — намеренный desktop-only выпуск.
3. Nonnumeric/prerelease имя не приводится к numeric base и не вычисляет `versionCode`.
Отсутствие matching name означает desktop-only; code-only проверка неприменима. Например,
`0.2.0-beta.1` с историей только `0.2.0` пропускает Android. Matching prerelease Android entry
недопустим и даёт FAIL.
`scripts/release.sh` вызывает `require-current` сразу после перехода в `androidApp`, до чтения
ключа, SDK и Gradle. Выпуск full/light/RuStore останавливается при отсутствующей или неверной
current-записи.
## GitHub Actions routing
Существующий `version` job остаётся источником строковой версии и проверки `v${version}` против
тега. Python 3.12 дополнительно выполняет `ci-intent` и публикует outputs `version`, `android`,
`intent`, условный `version_code`.
- Для tag `android` job выполняется только при `android == 'true'`; release gate повторно
запускается из `release.sh`.
- Для `workflow_dispatch` сохраняется build everything: `require-current` выполняется заранее,
поэтому missing current нельзя превратить в desktop-only.
- При intentional Android skip SDK, signing, `release.sh` и Android/RuStore uploads не выполняются;
пустые artifacts/placeholders не создаются. Остальные платформы не требуют `version_code`.
- `publish` на tag допускает Android `success` или `skipped`, но только при `success` всех jobs
`version/linux/flatpak/windows/macos`. Android `failure/cancelled` и failure любого другого job
публикацию запрещают. RuStore остаётся отдельным workflow artifact и удаляется из файлов GitHub
Release; checksums и список файлов включают только фактически созданные artifacts.
## Tests и общие fixtures
Общие с Kotlin contract fixtures лежат в `scripts/fixtures/release-notes/<case>/`:
- `android-release-notes.json` — исходный текст manifest;
- `Cargo.toml` и `tag.txt` — synthetic current version/tag;
- `expected.json` — ожидания `python_gate`, `require_current`, `ci_intent`, conditional
`version_code`/`android` и отдельные Kotlin-ожидания tolerant consumer (`safe history`,
`reject` либо `no crash`).
Запуск всех Python tests, включая статическую CI truth-table и shell test с temporary
key/Gradle stubs:
```sh
python3 -I -m unittest discover -s androidApp/scripts -p 'test_*.py'
bash -n androidApp/scripts/release.sh
python3 -I -m json.tool androidApp/app/src/main/assets/android-release-notes.json >/dev/null
```
Shell test доказывает порядок `gate → key → Gradle` и FAIL missing-current до ключа/Gradle без
реальной подписи или сборки. Локальные unittest/static checks не являются запуском GitHub Actions
и не заменяют реальные tag, CI, APK и publish-проверки.

View file

@ -1,47 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20502,
"versionName": "2.5.2",
"items": {
"en": [
"On Android, the “Game analysis” button is now easy to spot beside the engine and navigation controls, highlighted in the !! colour.",
"On Android, preparing for an opponent is simple: from a database or game, choose the player and colour, then explore continuations from their games on the board, with frequency and results (wins, draws and losses). Arrows show the moves; play them on the board or choose them from the list."
],
"ru": [
"На Android кнопка «Анализ партии» теперь на видном месте рядом с движком и навигацией и выделена цветом !!.",
"На Android легко подготовиться к сопернику: из базы или партии выберите игрока и цвет, а затем исследуйте на доске продолжения из его партий — с частотой и результатами (победы, ничьи, поражения). Стрелки подскажут ходы; играйте их на доске или выбирайте в списке."
],
"de": [
"Auf Android ist die Schaltfläche „Partieanalyse“ jetzt gut sichtbar neben Engine und Navigation und in der Farbe von !! hervorgehoben.",
"Auf Android bereitest du dich einfach auf einen Gegner vor: Wähle aus einer Datenbank oder Partie den Spieler und die Farbe und erkunde auf dem Brett Fortsetzungen aus seinen Partien mit Häufigkeit sowie Siegen, Remis und Niederlagen. Pfeile zeigen die Züge; spiele sie auf dem Brett oder wähle sie in der Liste."
],
"fr": [
"Sur Android, le bouton « Analyse de la partie » est désormais bien visible à côté du moteur et de la navigation, dans la couleur du !!.",
"Sur Android, préparez-vous simplement contre un adversaire : depuis une base ou une partie, choisissez le joueur et la couleur, puis explorez sur l’échiquier les continuations de ses parties, avec leur fréquence et leurs résultats (victoires, nulles, défaites). Les flèches indiquent les coups ; jouez-les sur l’échiquier ou choisissez-les dans la liste."
],
"es": [
"En Android, el botón «Análisis de la partida» ahora está bien visible junto al motor y la navegación, destacado con el color de !!.",
"En Android, prepararte contra un rival es sencillo: desde una base o una partida, elige el jugador y el color, y explora en el tablero las continuaciones de sus partidas con la frecuencia y los resultados (victorias, tablas y derrotas). Las flechas muestran las jugadas; juégalas en el tablero o elígelas en la lista."
],
"it": [
"Su Android, il pulsante «Analisi della partita» ora è in evidenza accanto al motore e alla navigazione e usa il colore di !!.",
"Su Android, prepararsi contro un avversario è semplice: da un database o da una partita scegli il giocatore e il colore, poi esplora sulla scacchiera le continuazioni delle sue partite con frequenza e risultati (vittorie, patte e sconfitte). Le frecce mostrano le mosse; giocale sulla scacchiera o sceglile dall’elenco."
],
"pt": [
"No Android, o botão «Análise da partida» está agora bem visível junto ao motor e à navegação, destacado com a cor de !!.",
"No Android, preparar-se contra um adversário é simples: a partir de uma base ou partida, escolha o jogador e a cor e explore no tabuleiro as continuações das suas partidas, com a frequência e os resultados (vitórias, empates e derrotas). As setas mostram os lances; jogue-os no tabuleiro ou escolha-os na lista."
],
"uz": [
"Androidda «Partiya tahlili» tugmasi endi dvigatel va navigatsiya yonida yaqqol ko‘rinadi hamda !! rangi bilan ajralib turadi.",
"Androidda raqibga tayyorlanish oson: baza yoki partiyadan o‘yinchi va rangni tanlang va uning partiyalaridagi davomlarni doskada chastota hamda natijalar (g‘alabalar, duranglar, mag‘lubiyatlar) bilan o‘rganing. Strelkalar yurishlarni ko‘rsatadi; ularni doskada bajaring yoki ro‘yxatdan tanlang."
],
"kk": [
"Android-де «Партияны талдау» батырмасы енді қозғалтқыш пен навигацияның қасынан оңай табылады және !! түсімен ерекшеленген.",
"Android-де қарсыласқа дайындалу оңай: базадан немесе партиядан ойыншы мен түсті таңдап, оның партияларындағы жалғастарды тақтадан зерттеңіз — жиілігі және нәтижелері (жеңістер, тең ойындар, жеңілістер) көрсетіледі. Көрсеткілер жүрістерді көрсетеді: оларды тақтада жасаңыз немесе тізімнен таңдаңыз."
]
}
}
]
}

View file

@ -6,7 +6,6 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import android.net.Uri import android.net.Uri
import android.provider.OpenableColumns import android.provider.OpenableColumns
import io.github.vrubelroman.chesspenguin.data.AndroidReleaseNotes
import io.github.vrubelroman.chesspenguin.data.AppUpdates import io.github.vrubelroman.chesspenguin.data.AppUpdates
import io.github.vrubelroman.chesspenguin.data.CLIPBOARD_PREFERENCES import io.github.vrubelroman.chesspenguin.data.CLIPBOARD_PREFERENCES
import io.github.vrubelroman.chesspenguin.data.ClipboardOffer import io.github.vrubelroman.chesspenguin.data.ClipboardOffer
@ -50,8 +49,6 @@ class ChessPenguinApp : Application() {
val sounds by lazy { Sounds(this, settings) } val sounds by lazy { Sounds(this, settings) }
/// Games from Lichess and Chess.com being downloaded (android-ui.md §23). /// Games from Lichess and Chess.com being downloaded (android-ui.md §23).
val downloads by lazy { OnlineDownloads(library, scope) } val downloads by lazy { OnlineDownloads(library, scope) }
/// Embedded post-update notes, independent of the app's own update flow.
val releaseNotes by lazy { AndroidReleaseNotes(this, scope) }
/// The app's own updates (android-ui.md §25). /// The app's own updates (android-ui.md §25).
val updates by lazy { AppUpdates(this, scope, engineFiles) } val updates by lazy { AppUpdates(this, scope, engineFiles) }
val clipboardPgn by lazy { val clipboardPgn by lazy {

View file

@ -85,9 +85,7 @@ class MainActivity : ComponentActivity() {
onDispose {} onDispose {}
} }
ChessPenguinTheme(darkTheme = dark) { ChessPenguinTheme(darkTheme = dark) {
Surface(Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { Surface(Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { MainNavigation() }
MainNavigation(coldLaunchEligible = savedInstanceState == null)
}
} }
} }
} }

View file

@ -14,9 +14,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
@ -28,20 +25,14 @@ import androidx.compose.ui.window.DialogProperties
import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.semantics
import io.github.vrubelroman.chesspenguin.data.DbEntry import io.github.vrubelroman.chesspenguin.data.DbEntry
import io.github.vrubelroman.chesspenguin.data.NoGames import io.github.vrubelroman.chesspenguin.data.NoGames
import io.github.vrubelroman.chesspenguin.data.ReleaseNotesDecision
import uniffi.mobile_api.ApiException import uniffi.mobile_api.ApiException
import java.io.FileNotFoundException import java.io.FileNotFoundException
import io.github.vrubelroman.chesspenguin.ui.app import io.github.vrubelroman.chesspenguin.ui.app
import io.github.vrubelroman.chesspenguin.ui.openProblem import io.github.vrubelroman.chesspenguin.ui.openProblem
import io.github.vrubelroman.chesspenguin.ui.UpdateSheet import io.github.vrubelroman.chesspenguin.ui.UpdateSheet
import io.github.vrubelroman.chesspenguin.ui.ReleaseNotesSheet
import io.github.vrubelroman.chesspenguin.ui.uiLanguage
import androidx.navigation3.runtime.NavKey import androidx.navigation3.runtime.NavKey
import androidx.navigation3.runtime.entryProvider import androidx.navigation3.runtime.entryProvider
import androidx.navigation3.runtime.rememberSaveableStateHolderNavEntryDecorator import androidx.navigation3.runtime.rememberSaveableStateHolderNavEntryDecorator
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.repeatOnLifecycle
import androidx.lifecycle.viewmodel.navigation3.rememberViewModelStoreNavEntryDecorator import androidx.lifecycle.viewmodel.navigation3.rememberViewModelStoreNavEntryDecorator
import androidx.navigation3.runtime.rememberNavBackStack import androidx.navigation3.runtime.rememberNavBackStack
import androidx.navigation3.ui.NavDisplay import androidx.navigation3.ui.NavDisplay
@ -86,7 +77,7 @@ import kotlinx.serialization.Serializable
@Serializable data object OnlineKey : NavKey @Serializable data object OnlineKey : NavKey
@Composable @Composable
fun MainNavigation(coldLaunchEligible: Boolean) { fun MainNavigation() {
val backStack = rememberNavBackStack(Databases) val backStack = rememberNavBackStack(Databases)
// A database just added from outside (the clipboard, another app): its list, or its // A database just added from outside (the clipboard, another app): its list, or its
// only game at once, over the list of databases. // only game at once, over the list of databases.
@ -101,47 +92,6 @@ fun MainNavigation(coldLaunchEligible: Boolean) {
backStack.add(GameAt(entry.id, 0)) backStack.add(GameAt(entry.id, 0))
} }
val app = app() val app = app()
val releaseNotes by app.releaseNotes.state.collectAsState()
var coldLaunchConsumed by rememberSaveable { mutableStateOf(!coldLaunchEligible) }
var releaseNotesAcknowledged by rememberSaveable { mutableStateOf(false) }
var releaseNotesDeferred by rememberSaveable { mutableStateOf(false) }
var awaitingRecreatedResume by rememberSaveable { mutableStateOf(!coldLaunchEligible) }
val lifecycleOwner = LocalLifecycleOwner.current
val lifecycleState by lifecycleOwner.lifecycle.currentStateFlow.collectAsState()
val language = uiLanguage()
LaunchedEffect(coldLaunchEligible, lifecycleOwner) {
if (!coldLaunchEligible) {
app.releaseNotes.skipColdPresentation()
} else if (!coldLaunchConsumed) {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
if (!coldLaunchConsumed) {
coldLaunchConsumed = true
app.releaseNotes.prepare(language)
}
}
}
}
LaunchedEffect(lifecycleState, releaseNotes.activePresentation, releaseNotes.presentedThisLaunch) {
if (releaseNotes.presentedThisLaunch) {
releaseNotesDeferred = false
awaitingRecreatedResume = false
} else if (lifecycleState == Lifecycle.State.RESUMED) {
if (awaitingRecreatedResume) {
releaseNotesDeferred = false
awaitingRecreatedResume = false
}
} else if (!awaitingRecreatedResume && releaseNotes.activePresentation != null) {
// A never-presented sheet belongs to this cold foreground visit only. Rotation
// gets one recreated RESUMED above and keeps the same application-lived snapshot.
releaseNotesDeferred = true
}
}
fun acknowledgeReleaseNotes() {
if (!releaseNotesAcknowledged) {
releaseNotesAcknowledged = true
app.releaseNotes.acknowledge()
}
}
val incoming by app.incoming.collectAsState() val incoming by app.incoming.collectAsState()
LaunchedEffect(incoming) { LaunchedEffect(incoming) {
when (val i = incoming) { when (val i = incoming) {
@ -160,10 +110,7 @@ fun MainNavigation(coldLaunchEligible: Boolean) {
// The app's update, over any screen (android-ui.md §25.3). // The app's update, over any screen (android-ui.md §25.3).
val updateSheet by app.updates.sheet.collectAsState() val updateSheet by app.updates.sheet.collectAsState()
if (updateSheet) UpdateSheet() if (updateSheet) UpdateSheet()
val releaseNotesUndecided = releaseNotes.decision == ReleaseNotesDecision.Undecided || val clipboardUnblocked = incoming == null && !updateSheet
releaseNotes.decision == ReleaseNotesDecision.Prepared
val releaseNotesVisible = releaseNotes.activePresentation != null && !releaseNotesAcknowledged
val clipboardUnblocked = incoming == null && !updateSheet && !releaseNotesUndecided && !releaseNotesVisible
val context = LocalContext.current val context = LocalContext.current
LaunchedEffect(clipboardUnblocked) { LaunchedEffect(clipboardUnblocked) {
if (clipboardUnblocked) app.clipboardPgn.check(clipboardText(context)) if (clipboardUnblocked) app.clipboardPgn.check(clipboardText(context))
@ -218,16 +165,6 @@ fun MainNavigation(coldLaunchEligible: Boolean) {
) )
else -> {} else -> {}
} }
val priorityOverlay = incoming is Incoming.Opening || incoming is Incoming.Failed || updateSheet
val presentation = releaseNotes.activePresentation
if (lifecycleState == Lifecycle.State.RESUMED && !priorityOverlay && presentation != null && !releaseNotesAcknowledged && !releaseNotesDeferred) {
ReleaseNotesSheet(
presentation = presentation,
alreadyPresented = releaseNotes.presentedThisLaunch,
onPresented = app.releaseNotes::markPresented,
onAcknowledge = ::acknowledgeReleaseNotes,
)
}
NavDisplay( NavDisplay(
backStack = backStack, backStack = backStack,
onBack = { backStack.removeLastOrNull() }, onBack = { backStack.removeLastOrNull() },

View file

@ -1,175 +0,0 @@
package io.github.vrubelroman.chesspenguin.data
import android.content.Context
import android.content.SharedPreferences
import android.util.Log
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.withContext
/// Packaged notes and their durable presentation state; no network or self-update calls.
class AndroidReleaseNotes(context: Context, private val scope: CoroutineScope) {
private val context = context.applicationContext
private val prefs by lazy { context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE) }
private val mutex = Mutex()
private val _state = MutableStateFlow(ReleaseNotesState())
val state: StateFlow<ReleaseNotesState> = _state.asStateFlow()
private var initialized = false
private var manifest = emptyReleaseNotesManifest()
private var currentCode = 0L
private var durablePrefs = ReleaseNotesPrefs(null, emptySet(), 0L)
init {
scope.launch { mutex.withLock { reconcileLocked() } }
}
/// Called once for a cold Activity after its first user RESUMED, never from onResume.
fun prepare(language: String) {
scope.launch {
mutex.withLock {
reconcileLocked()
if (_state.value.decision != ReleaseNotesDecision.Undecided) return@withLock
val releases = selectPresentation(
manifest,
durablePrefs.pendingCodes,
currentCode,
durablePrefs.lastPresentedCode,
language,
)
_state.value = if (releases.isEmpty()) {
ReleaseNotesState(ReleaseNotesDecision.NoSheet)
} else {
ReleaseNotesState(
ReleaseNotesDecision.Prepared,
ReleaseNotesPresentation(currentCode, releases),
)
}
}
}
}
/// A recreated Activity must not consume pending notes, but it also must not hold Updated.
fun skipColdPresentation() {
scope.launch {
mutex.withLock {
reconcileLocked()
if (_state.value.decision == ReleaseNotesDecision.Undecided) {
_state.value = ReleaseNotesState(ReleaseNotesDecision.NoSheet)
}
}
}
}
/// The visible, non-zero sheet has completed its following frame. The snapshot stays alive.
fun markPresented() {
scope.launch { mutex.withLock { markPresentedLocked() } }
}
fun acknowledge() {
scope.launch {
mutex.withLock {
if (_state.value.activePresentation == null) return@withLock
markPresentedLocked()
_state.value = acknowledgeReleaseNotesState(_state.value)
}
}
}
private suspend fun reconcileLocked() {
if (initialized) return
initialized = true
val loaded = withContext(Dispatchers.IO) {
val packaged = runCatching {
context.assets.open(ASSET_NAME).bufferedReader().use { it.readText() }
}.getOrNull()?.let(::parseReleaseNotesManifest) ?: emptyReleaseNotesManifest()
val packageInfo = runCatching {
context.packageManager.getPackageInfo(context.packageName, 0)
}.getOrNull()
val stored = readPrefs(prefs)
val code = packageInfo?.longVersionCode?.takeIf { it.validStoredCode() } ?: 0L
val next = if (packageInfo == null || code == 0L) {
stored
} else {
reconcileLaunch(
packaged,
stored,
code,
packageInfo.firstInstallTime,
packageInfo.lastUpdateTime,
)
}
val committed = next == stored || writePrefs(prefs, next)
LoadedNotes(
packaged,
code,
releaseNotesPrefsAfterCommit(stored, next, committed),
next,
committed,
)
}
if (!loaded.commitSucceeded && loaded.attempted != loaded.durable) {
Log.w(TAG, "Could not save Android release-notes launch state")
}
manifest = loaded.manifest
currentCode = loaded.currentCode
durablePrefs = loaded.durable
}
private suspend fun markPresentedLocked() {
val active = _state.value.activePresentation ?: return
if (_state.value.presentedThisLaunch) return
val attempted = markPresented(durablePrefs, active.currentCode)
val committed = withContext(Dispatchers.IO) { writePrefs(prefs, attempted) }
durablePrefs = releaseNotesPrefsAfterCommit(durablePrefs, attempted, committed)
if (!committed) Log.w(TAG, "Could not save Android release-notes presentation")
_state.value = _state.value.copy(
decision = ReleaseNotesDecision.Presented,
presentedThisLaunch = true,
)
}
private data class LoadedNotes(
val manifest: ReleaseNotesManifest,
val currentCode: Long,
val durable: ReleaseNotesPrefs,
val attempted: ReleaseNotesPrefs = durable,
val commitSucceeded: Boolean = true,
)
private companion object {
const val PREFERENCES_NAME = "android-release-notes"
const val ASSET_NAME = "android-release-notes.json"
const val TAG = "AndroidReleaseNotes"
}
}
private fun readPrefs(prefs: SharedPreferences): ReleaseNotesPrefs {
val launched = runCatching {
if (prefs.contains(LAST_LAUNCHED)) prefs.getLong(LAST_LAUNCHED, 0L) else null
}.getOrNull()?.takeIf { it.validStoredCode() }
val pending = runCatching { prefs.getStringSet(PENDING, null)?.toSet() }.getOrNull()
val presented = runCatching { prefs.getLong(LAST_PRESENTED, 0L) }.getOrDefault(0L)
.takeIf { it >= 0L && it <= Int.MAX_VALUE.toLong() } ?: 0L
return ReleaseNotesPrefs(launched, decodePendingCodes(pending), presented)
}
private fun writePrefs(prefs: SharedPreferences, state: ReleaseNotesPrefs): Boolean = runCatching {
val editor = prefs.edit()
if (state.lastLaunchedCode == null) editor.remove(LAST_LAUNCHED) else editor.putLong(LAST_LAUNCHED, state.lastLaunchedCode)
editor.putStringSet(PENDING, encodePendingCodes(state.pendingCodes).toSet())
editor.putLong(LAST_PRESENTED, state.lastPresentedCode)
editor.commit()
}.getOrDefault(false)
private fun Long.validStoredCode() = this in 1..Int.MAX_VALUE.toLong()
private const val LAST_LAUNCHED = "lastLaunchedCode"
private const val PENDING = "pendingCodes"
private const val LAST_PRESENTED = "lastPresentedCode"

View file

@ -1,185 +0,0 @@
package io.github.vrubelroman.chesspenguin.data
import kotlinx.serialization.Required
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json
@Serializable
data class ReleaseNotesManifest(
val schemaVersion: Int,
val releases: List<ReleaseNote>,
)
@Serializable
data class ReleaseNote(
val versionCode: Long,
val versionName: String,
@Required val items: Map<String, List<String>> = emptyMap(),
)
data class ReleaseNoteSelection(
val versionCode: Long,
val versionName: String,
val items: List<String>,
)
data class ReleaseNotesPrefs(
val lastLaunchedCode: Long?,
val pendingCodes: Set<Long>,
val lastPresentedCode: Long,
)
data class ReleaseNotesPresentation(
val currentCode: Long,
val releases: List<ReleaseNoteSelection>,
)
enum class ReleaseNotesDecision { Undecided, NoSheet, Prepared, Presented }
data class ReleaseNotesState(
val decision: ReleaseNotesDecision = ReleaseNotesDecision.Undecided,
val activePresentation: ReleaseNotesPresentation? = null,
val presentedThisLaunch: Boolean = false,
)
enum class ReleaseNotesUpdatedGate { Hold, Show, Suppress }
internal val RELEASE_NOTE_LANGUAGES = setOf("en", "ru", "de", "fr", "es", "it", "pt", "uz", "kk")
private const val MAX_RELEASE_VERSION_CODE = Int.MAX_VALUE.toLong()
private val RELEASE_VERSION_NAME = Regex("""([0-9]+)\.([0-9]+)\.([0-9]+)""")
private val releaseNotesJson = Json { ignoreUnknownKeys = true }
/// The release script is the strict gate. A damaged packaged asset only disables the sheet.
fun parseReleaseNotesManifest(text: String): ReleaseNotesManifest {
val manifest = runCatching {
releaseNotesJson.decodeFromString(ReleaseNotesManifest.serializer(), text)
}.getOrNull() ?: return emptyReleaseNotesManifest()
if (!validReleaseNotesManifest(manifest)) return emptyReleaseNotesManifest()
return manifest.copy(
releases = manifest.releases.map { note ->
note.copy(items = note.items.mapValues { (_, items) -> items.normalizedReleaseItems() })
},
)
}
fun emptyReleaseNotesManifest() = ReleaseNotesManifest(schemaVersion = 1, releases = emptyList())
fun selectItems(note: ReleaseNote, language: String): List<String>? {
val localized = note.items[language].normalizedReleaseItems()
if (localized.isNotEmpty()) return localized
return note.items["en"].normalizedReleaseItems().takeIf { it.isNotEmpty() }
}
fun selectPresentation(
manifest: ReleaseNotesManifest,
pending: Set<Long>,
currentCode: Long,
lastPresentedCode: Long,
language: String,
): List<ReleaseNoteSelection> = manifest.releases
.asSequence()
.filter { it.versionCode in pending }
.filter { it.versionCode > lastPresentedCode && it.versionCode <= currentCode }
.sortedByDescending(ReleaseNote::versionCode)
.mapNotNull { note ->
selectItems(note, language)?.let { items ->
ReleaseNoteSelection(note.versionCode, note.versionName, items)
}
}
.toList()
fun hasDisplayableItems(note: ReleaseNote): Boolean = note.items.any { (language, items) ->
language in RELEASE_NOTE_LANGUAGES && items.normalizedReleaseItems().isNotEmpty()
}
fun reconcileLaunch(
manifest: ReleaseNotesManifest,
prefs: ReleaseNotesPrefs,
currentCode: Long,
firstInstallTime: Long,
lastUpdateTime: Long,
): ReleaseNotesPrefs {
val pending = prefs.pendingCodes.filterTo(mutableSetOf()) { it.validReleaseVersionCode() }
val previous = prefs.lastLaunchedCode
if (previous == null) {
if (lastUpdateTime > firstInstallTime) {
manifest.releases.firstOrNull { it.versionCode == currentCode && hasDisplayableItems(it) }
?.let { pending += it.versionCode }
}
return prefs.copy(lastLaunchedCode = currentCode, pendingCodes = pending)
}
if (currentCode > previous) {
for (note in manifest.releases) {
if (note.versionCode > previous && note.versionCode <= currentCode && hasDisplayableItems(note)) {
pending += note.versionCode
}
}
return prefs.copy(lastLaunchedCode = currentCode, pendingCodes = pending)
}
return prefs.copy(pendingCodes = pending)
}
fun markPresented(prefs: ReleaseNotesPrefs, currentCode: Long): ReleaseNotesPrefs = prefs.copy(
pendingCodes = prefs.pendingCodes.filterTo(mutableSetOf()) { it > currentCode },
lastPresentedCode = maxOf(prefs.lastPresentedCode, currentCode),
)
fun decodePendingCodes(values: Set<String>?): Set<Long> = values.orEmpty().mapNotNullTo(mutableSetOf()) { value ->
value.toLongOrNull()?.takeIf { it.validReleaseVersionCode() }
}
fun encodePendingCodes(values: Set<Long>): Set<String> = values
.filter { it.validReleaseVersionCode() }
.mapTo(mutableSetOf()) { it.toString() }
fun releaseNotesPrefsAfterCommit(
durable: ReleaseNotesPrefs,
attempted: ReleaseNotesPrefs,
commitSucceeded: Boolean,
): ReleaseNotesPrefs = if (commitSucceeded) attempted else durable
fun acknowledgeReleaseNotesState(state: ReleaseNotesState): ReleaseNotesState {
if (state.activePresentation == null) return state
return state.copy(
decision = ReleaseNotesDecision.Presented,
activePresentation = null,
presentedThisLaunch = true,
)
}
fun releaseNotesUpdatedGate(state: ReleaseNotesState): ReleaseNotesUpdatedGate = when {
state.presentedThisLaunch -> ReleaseNotesUpdatedGate.Suppress
state.decision == ReleaseNotesDecision.NoSheet -> ReleaseNotesUpdatedGate.Show
else -> ReleaseNotesUpdatedGate.Hold
}
private fun List<String>?.normalizedReleaseItems(): List<String> = this.orEmpty()
.map(String::trim)
.filter(String::isNotEmpty)
private fun validReleaseNotesManifest(manifest: ReleaseNotesManifest): Boolean {
if (manifest.schemaVersion != 1) return false
val names = mutableSetOf<String>()
val codes = mutableSetOf<Long>()
var previousCode = 0L
for (note in manifest.releases) {
if (!note.versionCode.validReleaseVersionCode() || !validReleaseVersion(note.versionCode, note.versionName)) return false
if (note.versionCode <= previousCode || !codes.add(note.versionCode) || !names.add(note.versionName)) return false
if (note.items.keys.any { it !in RELEASE_NOTE_LANGUAGES }) return false
previousCode = note.versionCode
}
return true
}
private fun validReleaseVersion(code: Long, name: String): Boolean {
val match = RELEASE_VERSION_NAME.matchEntire(name) ?: return false
val major = match.groupValues[1].toLongOrNull() ?: return false
val minor = match.groupValues[2].toLongOrNull() ?: return false
val patch = match.groupValues[3].toLongOrNull() ?: return false
if (minor !in 0..99 || patch !in 0..99) return false
val remaining = MAX_RELEASE_VERSION_CODE - minor * 100 - patch
if (major > remaining / 10_000) return false
return major * 10_000 + minor * 100 + patch == code
}
private fun Long.validReleaseVersionCode() = this in 1..MAX_RELEASE_VERSION_CODE

View file

@ -1,93 +0,0 @@
package io.github.vrubelroman.chesspenguin.ui
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.Text
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshotFlow
import androidx.compose.runtime.withFrameNanos
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.heading
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
import io.github.vrubelroman.chesspenguin.R
import io.github.vrubelroman.chesspenguin.data.ReleaseNotesPresentation
import kotlinx.coroutines.flow.first
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ReleaseNotesSheet(
presentation: ReleaseNotesPresentation,
alreadyPresented: Boolean,
onPresented: () -> Unit,
onAcknowledge: () -> Unit,
) {
if (presentation.releases.isEmpty()) return
var hasLayout by remember(presentation) { mutableStateOf(false) }
LaunchedEffect(presentation, alreadyPresented) {
if (alreadyPresented) return@LaunchedEffect
snapshotFlow { hasLayout }.first { it }
withFrameNanos { }
onPresented()
}
ModalBottomSheet(
onDismissRequest = onAcknowledge,
sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
) {
Column(
Modifier
.fillMaxWidth()
.onSizeChanged { hasLayout = it.width > 0 && it.height > 0 }
.verticalScroll(rememberScrollState())
.padding(24.dp),
) {
Text(
stringResource(R.string.release_notes_title),
style = MaterialTheme.typography.titleLarge,
modifier = Modifier.semantics { heading() },
)
Spacer(Modifier.height(16.dp))
presentation.releases.forEachIndexed { index, release ->
if (index > 0) Spacer(Modifier.height(20.dp))
Text(
stringResource(R.string.release_notes_version, release.versionName),
style = MaterialTheme.typography.titleMedium,
modifier = Modifier.semantics { heading() },
)
Spacer(Modifier.height(8.dp))
release.items.forEach { item ->
Row(Modifier.fillMaxWidth().padding(bottom = 8.dp)) {
Text("•", style = MaterialTheme.typography.bodyLarge, modifier = Modifier.clearAndSetSemantics {})
Spacer(Modifier.width(8.dp))
Text(item, style = MaterialTheme.typography.bodyLarge, modifier = Modifier.weight(1f))
}
}
}
Spacer(Modifier.height(16.dp))
Button(onClick = onAcknowledge, modifier = Modifier.align(Alignment.End)) {
Text(stringResource(R.string.ok))
}
}
}
}

View file

@ -72,9 +72,7 @@ import io.github.vrubelroman.chesspenguin.BuildConfig
import io.github.vrubelroman.chesspenguin.R import io.github.vrubelroman.chesspenguin.R
import io.github.vrubelroman.chesspenguin.data.CheckState import io.github.vrubelroman.chesspenguin.data.CheckState
import io.github.vrubelroman.chesspenguin.data.NetState import io.github.vrubelroman.chesspenguin.data.NetState
import io.github.vrubelroman.chesspenguin.data.ReleaseNotesUpdatedGate
import io.github.vrubelroman.chesspenguin.data.UpdateMessage import io.github.vrubelroman.chesspenguin.data.UpdateMessage
import io.github.vrubelroman.chesspenguin.data.releaseNotesUpdatedGate
import io.github.vrubelroman.chesspenguin.data.UpdateProblem import io.github.vrubelroman.chesspenguin.data.UpdateProblem
import io.github.vrubelroman.chesspenguin.data.UpdateState import io.github.vrubelroman.chesspenguin.data.UpdateState
import io.github.vrubelroman.chesspenguin.data.UpdateStep import io.github.vrubelroman.chesspenguin.data.UpdateStep
@ -565,26 +563,9 @@ fun UpdateMessages(snackbar: SnackbarHostState) {
val cancelled = stringResource(R.string.download_cancelled) val cancelled = stringResource(R.string.download_cancelled)
val latest = stringResource(R.string.upd_latest) val latest = stringResource(R.string.upd_latest)
val doneText = (message as? UpdateMessage.Updated)?.let { stringResource(R.string.upd_done_snack, it.from, it.to) } val doneText = (message as? UpdateMessage.Updated)?.let { stringResource(R.string.upd_done_snack, it.from, it.to) }
val releaseNotes by app().releaseNotes.state.collectAsState()
val updatedGate = releaseNotesUpdatedGate(releaseNotes)
// Only the post-update message waits for the embedded sheet decision. Other messages
// keep their old effect and actions, independent of release-notes state changes.
LaunchedEffect(message, updatedGate) {
val m = message as? UpdateMessage.Updated ?: return@LaunchedEffect
when (updatedGate) {
ReleaseNotesUpdatedGate.Hold -> return@LaunchedEffect
ReleaseNotesUpdatedGate.Suppress -> updates.shown(m)
ReleaseNotesUpdatedGate.Show -> {
snackbar.currentSnackbarData?.dismiss()
snackbar.showSnackbar(doneText ?: "", duration = SnackbarDuration.Long)
updates.shown(m)
}
}
}
// Marked shown when its snackbar is gone: a screen left meanwhile hands it to the next. // Marked shown when its snackbar is gone: a screen left meanwhile hands it to the next.
LaunchedEffect(message) { LaunchedEffect(message) {
val m = message ?: return@LaunchedEffect val m = message ?: return@LaunchedEffect
if (m is UpdateMessage.Updated) return@LaunchedEffect
snackbar.currentSnackbarData?.dismiss() snackbar.currentSnackbarData?.dismiss()
when (m) { when (m) {
UpdateMessage.Ready -> { UpdateMessage.Ready -> {
@ -595,7 +576,7 @@ fun UpdateMessages(snackbar: SnackbarHostState) {
} }
UpdateMessage.Cancelled -> snackbar.showSnackbar(cancelled) UpdateMessage.Cancelled -> snackbar.showSnackbar(cancelled)
UpdateMessage.Latest -> snackbar.showSnackbar(latest) UpdateMessage.Latest -> snackbar.showSnackbar(latest)
is UpdateMessage.Updated -> {} is UpdateMessage.Updated -> snackbar.showSnackbar(doneText ?: "", duration = SnackbarDuration.Long)
} }
updates.shown(m) updates.shown(m)
} }

View file

@ -77,8 +77,6 @@
<string name="retry">Erneut versuchen</string> <string name="retry">Erneut versuchen</string>
<string name="download_again">Erneut herunterladen</string> <string name="download_again">Erneut herunterladen</string>
<string name="ok">OK</string> <string name="ok">OK</string>
<string name="release_notes_title">Neuigkeiten in ChessPenguin</string>
<string name="release_notes_version">Version %1$s</string>
<string name="preparing_engine">Engine wird vorbereitet…</string> <string name="preparing_engine">Engine wird vorbereitet…</string>
<string name="settings">Einstellungen</string> <string name="settings">Einstellungen</string>

View file

@ -78,8 +78,6 @@
<string name="retry">Reintentar</string> <string name="retry">Reintentar</string>
<string name="download_again">Descargar de nuevo</string> <string name="download_again">Descargar de nuevo</string>
<string name="ok">Aceptar</string> <string name="ok">Aceptar</string>
<string name="release_notes_title">Novedades de ChessPenguin</string>
<string name="release_notes_version">Versión %1$s</string>
<string name="preparing_engine">Preparando el motor…</string> <string name="preparing_engine">Preparando el motor…</string>
<string name="settings">Ajustes</string> <string name="settings">Ajustes</string>

View file

@ -78,8 +78,6 @@
<string name="retry">Réessayer</string> <string name="retry">Réessayer</string>
<string name="download_again">Télécharger à nouveau</string> <string name="download_again">Télécharger à nouveau</string>
<string name="ok">OK</string> <string name="ok">OK</string>
<string name="release_notes_title">Nouveautés de ChessPenguin</string>
<string name="release_notes_version">Version %1$s</string>
<string name="preparing_engine">Préparation du moteur…</string> <string name="preparing_engine">Préparation du moteur…</string>
<string name="settings">Paramètres</string> <string name="settings">Paramètres</string>

View file

@ -78,8 +78,6 @@
<string name="retry">Riprova</string> <string name="retry">Riprova</string>
<string name="download_again">Scarica di nuovo</string> <string name="download_again">Scarica di nuovo</string>
<string name="ok">OK</string> <string name="ok">OK</string>
<string name="release_notes_title">Novità in ChessPenguin</string>
<string name="release_notes_version">Versione %1$s</string>
<string name="preparing_engine">Preparazione del motore…</string> <string name="preparing_engine">Preparazione del motore…</string>
<string name="settings">Impostazioni</string> <string name="settings">Impostazioni</string>

View file

@ -77,8 +77,6 @@
<string name="retry">Қайталап көру</string> <string name="retry">Қайталап көру</string>
<string name="download_again">Қайта жүктеу</string> <string name="download_again">Қайта жүктеу</string>
<string name="ok">OK</string> <string name="ok">OK</string>
<string name="release_notes_title">ChessPenguin жаңалықтары</string>
<string name="release_notes_version">Нұсқа %1$s</string>
<string name="preparing_engine">Қозғалтқыш дайындалуда…</string> <string name="preparing_engine">Қозғалтқыш дайындалуда…</string>
<string name="settings">Баптаулар</string> <string name="settings">Баптаулар</string>

View file

@ -78,8 +78,6 @@
<string name="retry">Tentar de novo</string> <string name="retry">Tentar de novo</string>
<string name="download_again">Baixar de novo</string> <string name="download_again">Baixar de novo</string>
<string name="ok">OK</string> <string name="ok">OK</string>
<string name="release_notes_title">Novidades do ChessPenguin</string>
<string name="release_notes_version">Versão %1$s</string>
<string name="preparing_engine">Preparando o motor…</string> <string name="preparing_engine">Preparando o motor…</string>
<string name="settings">Configurações</string> <string name="settings">Configurações</string>

View file

@ -79,8 +79,6 @@
<string name="retry">Повторить</string> <string name="retry">Повторить</string>
<string name="download_again">Скачать снова</string> <string name="download_again">Скачать снова</string>
<string name="ok">Понятно</string> <string name="ok">Понятно</string>
<string name="release_notes_title">Что нового в ChessPenguin</string>
<string name="release_notes_version">Версия %1$s</string>
<string name="preparing_engine">Готовлю движок…</string> <string name="preparing_engine">Готовлю движок…</string>
<string name="settings">Настройки</string> <string name="settings">Настройки</string>

View file

@ -78,8 +78,6 @@
<string name="retry">Qayta urinish</string> <string name="retry">Qayta urinish</string>
<string name="download_again">Qayta yuklab olish</string> <string name="download_again">Qayta yuklab olish</string>
<string name="ok">OK</string> <string name="ok">OK</string>
<string name="release_notes_title">ChessPenguin’dagi yangiliklar</string>
<string name="release_notes_version">Versiya %1$s</string>
<string name="preparing_engine">Dvigatel tayyorlanmoqda…</string> <string name="preparing_engine">Dvigatel tayyorlanmoqda…</string>
<string name="settings">Sozlamalar</string> <string name="settings">Sozlamalar</string>

View file

@ -78,8 +78,6 @@
<string name="retry">Try again</string> <string name="retry">Try again</string>
<string name="download_again">Download again</string> <string name="download_again">Download again</string>
<string name="ok">OK</string> <string name="ok">OK</string>
<string name="release_notes_title">What’s new in ChessPenguin</string>
<string name="release_notes_version">Version %1$s</string>
<string name="preparing_engine">Preparing the engine…</string> <string name="preparing_engine">Preparing the engine…</string>
<string name="settings">Settings</string> <string name="settings">Settings</string>

View file

@ -1,120 +0,0 @@
package io.github.vrubelroman.chesspenguin.data
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import java.io.File
class ReleaseNotesModelTest {
@Test
fun `shared fixtures honor the tolerant consumer contract`() {
val fixtures = fixtureRoot().listFiles()?.filter { it.isDirectory }?.sortedBy(File::getName).orEmpty()
assertTrue("No shared release-notes fixtures found", fixtures.isNotEmpty())
for (fixture in fixtures) {
val expectedFile = File(fixture, "expected.json")
if (!expectedFile.isFile) continue
val expected = Json.parseToJsonElement(expectedFile.readText()).jsonObject
val expectation = expected.getValue("kotlin").jsonPrimitive.content
val parsed = parseReleaseNotesManifest(File(fixture, "android-release-notes.json").readText())
when (expectation) {
"safe history" -> assertTrue(fixture.name, parsed.schemaVersion == 1)
"reject" -> assertTrue(fixture.name, parsed.releases.isEmpty())
"no crash" -> assertTrue(fixture.name, parsed.schemaVersion == 1)
else -> throw AssertionError("${fixture.name}: unknown Kotlin expectation $expectation")
}
assertTrue(fixture.name, expected.getValue("kotlin_no_crash").jsonPrimitive.content.toBooleanStrict())
}
}
@Test
fun `valid items are trimmed without changing their order`() {
val parsed = parseReleaseNotesManifest(
"""
{"schemaVersion":1,"releases":[{"versionCode":20502,"versionName":"2.5.2","items":{
"en":[" first ","\nsecond\t"," "],"ru":[" русский "]
}}]}
""".trimIndent(),
)
assertEquals(listOf("first", "second"), selectItems(parsed.releases.single(), "en"))
assertEquals(listOf("русский"), selectItems(parsed.releases.single(), "ru"))
}
@Test
fun `explicit empty and blank-only entries have no displayable items`() {
for (name in listOf("empty", "blank")) {
val parsed = parseReleaseNotesManifest(File(fixtureRoot(), "$name/android-release-notes.json").readText())
val note = parsed.releases.single()
assertFalse(name, hasDisplayableItems(note))
assertEquals(name, null, selectItems(note, "ru"))
assertTrue(name, selectPresentation(parsed, setOf(20502), 20502, 0, "ru").isEmpty())
}
}
@Test
fun `detectably invalid manifests are rejected as a whole`() {
val invalid = listOf(
"not json",
"{}",
"""{"schemaVersion":2,"releases":[]}""",
"""{"schemaVersion":1,"releases":[{"versionCode":20502,"versionName":"2.5.2"}]}""",
"""{"schemaVersion":1,"releases":[{"versionCode":20503,"versionName":"2.5.2","items":{}}]}""",
"""{"schemaVersion":1,"releases":[{"versionCode":20502,"versionName":"2.5.2-beta","items":{}}]}""",
"""{"schemaVersion":1,"releases":[{"versionCode":200,"versionName":"0.2.100","items":{}}]}""",
"""{"schemaVersion":1,"releases":[{"versionCode":2147483648,"versionName":"214748.36.48","items":{}}]}""",
"""{"schemaVersion":1,"releases":[{"versionCode":20502,"versionName":"2.5.2","items":{"xx":["unknown"]}}]}""",
"""{"schemaVersion":1,"releases":[{"versionCode":20502,"versionName":"2.5.2","items":{"en":[1]}}]}""",
"""{"schemaVersion":1,"releases":[
{"versionCode":20502,"versionName":"2.5.2","items":{}},
{"versionCode":20502,"versionName":"2.5.3","items":{}}
]}""",
"""{"schemaVersion":1,"releases":[
{"versionCode":20502,"versionName":"2.5.2","items":{}},
{"versionCode":20503,"versionName":"2.5.2","items":{}}
]}""",
"""{"schemaVersion":1,"releases":[
{"versionCode":20503,"versionName":"2.5.3","items":{}},
{"versionCode":20502,"versionName":"2.5.2","items":{}}
]}""",
)
for (json in invalid) {
assertTrue(json, parseReleaseNotesManifest(json).releases.isEmpty())
}
}
@Test
fun `duplicate JSON keys are not treated as release validation`() {
val duplicateKeys = """
{"schemaVersion":1,"schemaVersion":1,"releases":[
{"versionCode":20502,"versionName":"2.5.2","versionName":"2.5.2","items":{"en":["last value"]}}
]}
""".trimIndent()
val consumed = runCatching { parseReleaseNotesManifest(duplicateKeys) }
assertTrue(consumed.isSuccess)
assertEquals(1, consumed.getOrThrow().schemaVersion)
}
@Test
fun `only known languages count for pending displayability`() {
val known = ReleaseNote(20502, "2.5.2", mapOf("kk" to listOf(" өзгеріс ")))
val unknown = ReleaseNote(20502, "2.5.2", mapOf("xx" to listOf("unknown")))
assertTrue(hasDisplayableItems(known))
assertFalse(hasDisplayableItems(unknown))
}
private fun fixtureRoot(): File {
val start = File(System.getProperty("user.dir") ?: ".").absoluteFile
return generateSequence(start) { it.parentFile }
.map { File(it, "androidApp/scripts/fixtures/release-notes") }
.firstOrNull { it.isDirectory }
?: throw AssertionError("Cannot locate shared release-notes fixtures from $start")
}
}

View file

@ -1,148 +0,0 @@
package io.github.vrubelroman.chesspenguin.data
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
class ReleaseNotesStateTest {
private val manifest = ReleaseNotesManifest(
1,
listOf(
ReleaseNote(20400, "2.4.0", mapOf("en" to listOf("old"))),
ReleaseNote(20500, "2.5.0", mapOf("en" to listOf("skipped"))),
ReleaseNote(20501, "2.5.1", emptyMap()),
ReleaseNote(20502, "2.5.2", mapOf("ru" to listOf("current"))),
),
)
@Test
fun `fresh timestamp heuristic records marker without pending or backfill`() {
val initial = ReleaseNotesPrefs(null, emptySet(), 0)
val fresh = reconcileLaunch(manifest, initial, 20502, firstInstallTime = 100, lastUpdateTime = 100)
val restartedWithOppositeTimestamps = reconcileLaunch(manifest, fresh, 20502, 100, 200)
assertEquals(20502L, fresh.lastLaunchedCode)
assertTrue(fresh.pendingCodes.isEmpty())
assertEquals(fresh, restartedWithOppositeTimestamps)
}
@Test
fun `migration timestamp heuristic adds only current and later ignores timestamps`() {
val initial = ReleaseNotesPrefs(null, emptySet(), 0)
val migration = reconcileLaunch(manifest, initial, 20502, firstInstallTime = 100, lastUpdateTime = 200)
val restartedWithOppositeTimestamps = reconcileLaunch(manifest, migration, 20502, 200, 100)
assertEquals(setOf(20502L), migration.pendingCodes)
assertEquals(20502L, migration.lastLaunchedCode)
assertEquals(migration, restartedWithOppositeTimestamps)
}
@Test
fun `vendor false positive and false negative never reconstruct earlier history`() {
val initial = ReleaseNotesPrefs(null, emptySet(), 0)
val falsePositiveFresh = reconcileLaunch(manifest, initial, 20502, 100, 200)
val falseNegativeUpgrade = reconcileLaunch(manifest, initial, 20502, 200, 100)
assertEquals(setOf(20502L), falsePositiveFresh.pendingCodes)
assertTrue(falseNegativeUpgrade.pendingCodes.isEmpty())
}
@Test
fun `known previous range unions pending and skips empty releases`() {
val prefs = ReleaseNotesPrefs(20400, setOf(20300L), 20300)
val upgraded = reconcileLaunch(manifest, prefs, 20502, 100, 100)
val repeated = reconcileLaunch(manifest, upgraded, 20502, 100, 999)
assertEquals(setOf(20300L, 20500L, 20502L), upgraded.pendingCodes)
assertEquals(20502L, upgraded.lastLaunchedCode)
assertEquals(upgraded, repeated)
}
@Test
fun `downgrade preserves markers and future selection until newer code returns`() {
val prefs = ReleaseNotesPrefs(20502, setOf(20502L), 20400)
val downgraded = reconcileLaunch(manifest, prefs, 20501, 100, 999)
val futureSelection = selectPresentation(manifest, downgraded.pendingCodes, 20501, downgraded.lastPresentedCode, "ru")
val returned = reconcileLaunch(manifest, downgraded, 20502, 999, 100)
val restoredSelection = selectPresentation(manifest, returned.pendingCodes, 20502, returned.lastPresentedCode, "ru")
assertEquals(prefs, downgraded)
assertTrue(futureSelection.isEmpty())
assertEquals(prefs, returned)
assertEquals(listOf(20502L), restoredSelection.map { it.versionCode })
}
@Test
fun `damaged pending decimals are copied filtered and encoded safely`() {
val raw = setOf("20502", "0", "-1", "abc", " 20500", "2147483648", "20500")
val copied = raw.toSet()
val decoded = decodePendingCodes(copied)
assertEquals(setOf(20500L, 20502L), decoded)
assertEquals(setOf("20500", "20502"), encodePendingCodes(decoded))
assertEquals(raw, copied)
}
@Test
fun `process death before presentation retains pending but durable mark removes it`() {
val beforePresentation = reconcileLaunch(manifest, ReleaseNotesPrefs(null, emptySet(), 0), 20502, 100, 200)
val restoredBeforePresentation = beforePresentation.copy(pendingCodes = beforePresentation.pendingCodes.toSet())
assertEquals(setOf(20502L), restoredBeforePresentation.pendingCodes)
val presented = markPresented(restoredBeforePresentation, 20502)
val restoredAfterPresentation = presented.copy(pendingCodes = presented.pendingCodes.toSet())
assertTrue(presented.pendingCodes.isEmpty())
assertEquals(20502L, presented.lastPresentedCode)
assertTrue(selectPresentation(manifest, restoredAfterPresentation.pendingCodes, 20502, 20502, "ru").isEmpty())
}
@Test
fun `mark is idempotent preserves future pending and never lowers presented marker`() {
val prefs = ReleaseNotesPrefs(20502, setOf(20500L, 20502L, 20503L), 20503)
val first = markPresented(prefs, 20502)
val repeated = markPresented(first, 20502)
assertEquals(setOf(20503L), first.pendingCodes)
assertEquals(20503L, first.lastPresentedCode)
assertEquals(first, repeated)
}
@Test
fun `acknowledge closes the same snapshot once and repeated acknowledge is inert`() {
val active = ReleaseNotesPresentation(
20502,
listOf(ReleaseNoteSelection(20502, "2.5.2", listOf("current"))),
)
val visible = ReleaseNotesState(ReleaseNotesDecision.Presented, active, presentedThisLaunch = true)
val acknowledged = acknowledgeReleaseNotesState(visible)
val repeated = acknowledgeReleaseNotesState(acknowledged)
assertEquals(ReleaseNotesDecision.Presented, acknowledged.decision)
assertEquals(null, acknowledged.activePresentation)
assertTrue(acknowledged.presentedThisLaunch)
assertEquals(acknowledged, repeated)
}
@Test
fun `failed commit keeps previous durable snapshot instead of attempted state`() {
val durable = ReleaseNotesPrefs(20502, setOf(20502L), 20400)
val attempted = markPresented(durable, 20502)
val failed = releaseNotesPrefsAfterCommit(durable, attempted, commitSucceeded = false)
val succeeded = releaseNotesPrefsAfterCommit(durable, attempted, commitSucceeded = true)
assertEquals(durable, failed)
assertEquals(setOf(20502L), failed.pendingCodes)
assertEquals(attempted, succeeded)
assertTrue(succeeded.pendingCodes.isEmpty())
}
}

View file

@ -1,87 +0,0 @@
package io.github.vrubelroman.chesspenguin.ui
import io.github.vrubelroman.chesspenguin.data.ReleaseNote
import io.github.vrubelroman.chesspenguin.data.ReleaseNotesManifest
import io.github.vrubelroman.chesspenguin.data.selectItems
import io.github.vrubelroman.chesspenguin.data.selectPresentation
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Test
class ReleaseNotesSelectionTest {
@Test
fun `each release selects UI language then English then skips`() {
val manifest = ReleaseNotesManifest(
1,
listOf(
ReleaseNote(20500, "2.5.0", mapOf("ru" to listOf("Русский"), "en" to listOf("English"))),
ReleaseNote(20501, "2.5.1", mapOf("en" to listOf("Fallback"))),
ReleaseNote(20502, "2.5.2", mapOf("de" to listOf("Nur Deutsch"))),
),
)
val pending = setOf(20500L, 20501L, 20502L)
val selected = selectPresentation(manifest, pending, 20502, 0, "ru")
assertEquals(listOf(20501L, 20500L), selected.map { it.versionCode })
assertEquals(listOf("Fallback"), selected[0].items)
assertEquals(listOf("Русский"), selected[1].items)
assertNull(selectItems(manifest.releases[2], "ru"))
}
@Test
fun `numeric newest-first differs from lexical version-name order`() {
val manifest = ReleaseNotesManifest(
1,
listOf(
ReleaseNote(99_999, "9.99.99", mapOf("en" to listOf("older"))),
ReleaseNote(100_000, "10.0.0", mapOf("en" to listOf("newest"))),
),
)
val selected = selectPresentation(manifest, setOf(99_999L, 100_000L), 100_000, 0, "en")
assertEquals(listOf(100_000L, 99_999L), selected.map { it.versionCode })
assertEquals(listOf("10.0.0", "9.99.99"), selected.map { it.versionName })
}
@Test
fun `blank items are filtered and empty selection does not create a presentation`() {
val note = ReleaseNote(
20502,
"2.5.2",
mapOf("ru" to listOf(" ", "\n"), "en" to listOf("", " meaningful ", "\t")),
)
val manifest = ReleaseNotesManifest(1, listOf(note))
assertEquals(listOf("meaningful"), selectItems(note, "ru"))
assertEquals(
listOf("meaningful"),
selectPresentation(manifest, setOf(20502L), 20502, 0, "ru").single().items,
)
val blank = manifest.copy(releases = listOf(note.copy(items = mapOf("ru" to listOf(" "), "en" to listOf("\n")))))
assertTrue(selectPresentation(blank, setOf(20502L), 20502, 0, "ru").isEmpty())
}
@Test
fun `selection joins pending and excludes presented current-future and missing releases`() {
val manifest = ReleaseNotesManifest(
1,
listOf(
ReleaseNote(20400, "2.4.0", mapOf("en" to listOf("presented"))),
ReleaseNote(20500, "2.5.0", mapOf("en" to listOf("pending"))),
ReleaseNote(20502, "2.5.2", mapOf("en" to listOf("current"))),
ReleaseNote(20503, "2.5.3", mapOf("en" to listOf("future"))),
),
)
val pending = setOf(20400L, 20500L, 20501L, 20502L, 20503L)
val unchanged = pending.toSet()
val selected = selectPresentation(manifest, pending, 20502, 20400, "ru")
selectPresentation(manifest, pending, 20502, 20400, "de")
assertEquals(listOf(20502L, 20500L), selected.map { it.versionCode })
assertEquals(unchanged, pending)
}
}

View file

@ -1,53 +0,0 @@
package io.github.vrubelroman.chesspenguin.ui
import io.github.vrubelroman.chesspenguin.data.ReleaseNoteSelection
import io.github.vrubelroman.chesspenguin.data.ReleaseNotesDecision
import io.github.vrubelroman.chesspenguin.data.ReleaseNotesPresentation
import io.github.vrubelroman.chesspenguin.data.ReleaseNotesState
import io.github.vrubelroman.chesspenguin.data.ReleaseNotesUpdatedGate
import io.github.vrubelroman.chesspenguin.data.releaseNotesUpdatedGate
import org.junit.Assert.assertEquals
import org.junit.Test
class ReleaseNotesUpdatedGateTest {
private val presentation = ReleaseNotesPresentation(
20502,
listOf(ReleaseNoteSelection(20502, "2.5.2", listOf("Change"))),
)
@Test
fun `undecided and prepared but not presented hold Updated without consuming it`() {
assertEquals(ReleaseNotesUpdatedGate.Hold, releaseNotesUpdatedGate(ReleaseNotesState()))
assertEquals(
ReleaseNotesUpdatedGate.Hold,
releaseNotesUpdatedGate(ReleaseNotesState(ReleaseNotesDecision.Prepared, presentation)),
)
}
@Test
fun `actual presentation suppresses Updated during and after sheet acknowledge`() {
val visible = ReleaseNotesState(ReleaseNotesDecision.Presented, presentation, presentedThisLaunch = true)
val acknowledged = visible.copy(activePresentation = null)
assertEquals(ReleaseNotesUpdatedGate.Suppress, releaseNotesUpdatedGate(visible))
assertEquals(ReleaseNotesUpdatedGate.Suppress, releaseNotesUpdatedGate(acknowledged))
}
@Test
fun `NoSheet preserves the old Updated snackbar path`() {
val noSheet = ReleaseNotesState(ReleaseNotesDecision.NoSheet)
assertEquals(ReleaseNotesUpdatedGate.Show, releaseNotesUpdatedGate(noSheet))
}
@Test
fun `commit failure still suppresses snackbar for the current visible presentation`() {
val commitFailedButVisible = ReleaseNotesState(
decision = ReleaseNotesDecision.Presented,
activePresentation = presentation,
presentedThisLaunch = true,
)
assertEquals(ReleaseNotesUpdatedGate.Suppress, releaseNotesUpdatedGate(commitFailedButVisible))
}
}

View file

@ -1,318 +0,0 @@
#!/usr/bin/env python3
"""Validate the canonical Android release-notes manifest and classify CI intent."""
from __future__ import annotations
import argparse
import json
import re
import sys
import tomllib
from pathlib import Path
from typing import Any
INT_MAX = 2_147_483_647
LANGUAGES = frozenset({"en", "ru", "de", "fr", "es", "it", "pt", "uz", "kk"})
MANIFEST_PATH = Path("androidApp/app/src/main/assets/android-release-notes.json")
NUMERIC_VERSION = re.compile(r"^([0-9]+)\.([0-9]+)\.([0-9]+)$")
class ReleaseNotesError(Exception):
"""A user-facing manifest or release-version error."""
def _object_without_duplicate_keys(pairs: list[tuple[str, Any]]) -> dict[str, Any]:
result: dict[str, Any] = {}
for key, value in pairs:
if key in result:
raise ReleaseNotesError(f"duplicate JSON key {key!r}")
result[key] = value
return result
def load_manifest(path: Path) -> dict[str, Any]:
try:
text = path.read_text(encoding="utf-8")
except OSError as exc:
raise ReleaseNotesError(f"cannot read {path}: {exc}") from exc
except UnicodeError as exc:
raise ReleaseNotesError(f"{path} is not valid UTF-8: {exc}") from exc
try:
manifest = json.loads(text, object_pairs_hook=_object_without_duplicate_keys)
except json.JSONDecodeError as exc:
raise ReleaseNotesError(
f"{path}: malformed JSON at line {exc.lineno}, column {exc.colno}: {exc.msg}"
) from exc
return validate_manifest(manifest)
def _is_int(value: Any) -> bool:
return isinstance(value, int) and not isinstance(value, bool)
def _numeric_version(version_name: str, context: str) -> tuple[int, int, int, int]:
match = NUMERIC_VERSION.fullmatch(version_name)
if match is None:
raise ReleaseNotesError(
f"{context}: versionName {version_name!r} must be numeric major.minor.patch"
)
try:
major, minor, patch = (int(component) for component in match.groups())
except ValueError as exc:
raise ReleaseNotesError(f"{context}: numeric version component is too large") from exc
if minor > 99 or patch > 99:
raise ReleaseNotesError(f"{context}: minor and patch must be in 0..99")
version_code = major * 10_000 + minor * 100 + patch
if version_code <= 0 or version_code > INT_MAX:
raise ReleaseNotesError(
f"{context}: computed versionCode must be in 1..{INT_MAX}"
)
return major, minor, patch, version_code
def validate_manifest(manifest: Any) -> dict[str, Any]:
if not isinstance(manifest, dict):
raise ReleaseNotesError("manifest root must be an object")
if not _is_int(manifest.get("schemaVersion")) or manifest["schemaVersion"] != 1:
raise ReleaseNotesError("schemaVersion must be integer 1")
releases = manifest.get("releases")
if not isinstance(releases, list):
raise ReleaseNotesError("releases must be a list")
expected_codes: list[int] = []
for index, release in enumerate(releases):
context = f"releases[{index}]"
if not isinstance(release, dict):
raise ReleaseNotesError(f"{context} must be an object")
for field in ("versionCode", "versionName", "items"):
if field not in release:
raise ReleaseNotesError(f"{context}: missing required field {field}")
version_code = release["versionCode"]
version_name = release["versionName"]
if not _is_int(version_code):
raise ReleaseNotesError(f"{context}.versionCode must be an integer")
if version_code <= 0 or version_code > INT_MAX:
raise ReleaseNotesError(
f"{context}.versionCode must be in 1..{INT_MAX}"
)
if not isinstance(version_name, str) or not version_name:
raise ReleaseNotesError(f"{context}.versionName must be a non-empty string")
_, _, _, expected_code = _numeric_version(version_name, context)
expected_codes.append(expected_code)
items = release["items"]
if not isinstance(items, dict):
raise ReleaseNotesError(f"{context}.items must be an object")
for language, localized_items in items.items():
if language not in LANGUAGES:
raise ReleaseNotesError(f"{context}.items: unknown language {language!r}")
if not isinstance(localized_items, list):
raise ReleaseNotesError(
f"{context}.items.{language} must be a list of strings"
)
for item_index, item in enumerate(localized_items):
if not isinstance(item, str):
raise ReleaseNotesError(
f"{context}.items.{language}[{item_index}] must be a string"
)
seen_codes: dict[int, int] = {}
seen_names: dict[str, int] = {}
for index, release in enumerate(releases):
version_code = release["versionCode"]
version_name = release["versionName"]
if version_code in seen_codes:
raise ReleaseNotesError(
f"releases[{index}]: duplicate versionCode {version_code} "
f"(first used in releases[{seen_codes[version_code]}])"
)
if version_name in seen_names:
raise ReleaseNotesError(
f"releases[{index}]: duplicate versionName {version_name!r} "
f"(first used in releases[{seen_names[version_name]}])"
)
seen_codes[version_code] = index
seen_names[version_name] = index
previous_code = 0
for index, release in enumerate(releases):
version_code = release["versionCode"]
expected_code = expected_codes[index]
if version_code != expected_code:
raise ReleaseNotesError(
f"releases[{index}]: versionCode {version_code} does not match "
f"{release['versionName']} (expected {expected_code})"
)
if version_code <= previous_code:
raise ReleaseNotesError(
f"releases[{index}]: versionCode regression "
f"{version_code} after {previous_code}"
)
previous_code = version_code
return manifest
def read_current_version(repo_root: Path) -> str:
cargo_toml = repo_root / "Cargo.toml"
try:
with cargo_toml.open("rb") as source:
cargo = tomllib.load(source)
except OSError as exc:
raise ReleaseNotesError(f"cannot read {cargo_toml}: {exc}") from exc
except (tomllib.TOMLDecodeError, UnicodeError) as exc:
raise ReleaseNotesError(f"cannot parse {cargo_toml}: {exc}") from exc
workspace = cargo.get("workspace")
package = workspace.get("package") if isinstance(workspace, dict) else None
version = package.get("version") if isinstance(package, dict) else None
if version is None:
raise ReleaseNotesError("Cargo.toml has no workspace.package.version")
if not isinstance(version, str) or not version:
raise ReleaseNotesError("workspace.package.version must be a non-empty string")
return version
def _current_match(
manifest: dict[str, Any], version_name: str, version_code: int
) -> tuple[int, dict[str, Any]] | None:
for index, release in enumerate(manifest["releases"]):
if release["versionName"] == version_name and release["versionCode"] == version_code:
return index, release
return None
def require_current(manifest: dict[str, Any], version_name: str) -> dict[str, Any]:
_, _, _, version_code = _numeric_version(version_name, "workspace.package.version")
match = _current_match(manifest, version_name, version_code)
releases = manifest["releases"]
if match is not None:
index, release = match
if index != len(releases) - 1:
raise ReleaseNotesError(
f"current release {version_name} must be the last manifest entry"
)
return release
name_match = next(
(release for release in releases if release["versionName"] == version_name), None
)
if name_match is not None:
raise ReleaseNotesError(
f"current release name {version_name} has mismatched versionCode "
f"{name_match['versionCode']}; expected {version_code}"
)
code_match = next(
(release for release in releases if release["versionCode"] == version_code), None
)
if code_match is not None:
raise ReleaseNotesError(
f"current versionCode {version_code} belongs to "
f"{code_match['versionName']}, not {version_name}"
)
raise ReleaseNotesError(
f"current Android release is missing: expected versionName={version_name}, "
f"versionCode={version_code} as the last entry"
)
def classify_ci_intent(
manifest: dict[str, Any], current_version: str
) -> dict[str, str | int | bool]:
"""Classify only after manifest validation; never strip a prerelease suffix."""
version_name = current_version[1:] if current_version.startswith("v") else current_version
result: dict[str, str | int | bool] = {"version": version_name}
if NUMERIC_VERSION.fullmatch(version_name) is None:
if any(
release["versionName"] == version_name for release in manifest["releases"]
):
raise ReleaseNotesError(
f"non-numeric/prerelease current version {version_name!r} "
"has a matching Android entry"
)
result.update(android=False, intent="desktop-only")
return result
_, _, _, version_code = _numeric_version(version_name, "current CI version")
match = _current_match(manifest, version_name, version_code)
if match is not None:
index, _ = match
if index != len(manifest["releases"]) - 1:
raise ReleaseNotesError(
f"current Android release {version_name} must be the last manifest entry"
)
result.update(
version_code=version_code,
android=True,
intent="android",
)
return result
name_match = next(
(
release
for release in manifest["releases"]
if release["versionName"] == version_name
),
None,
)
code_match = next(
(
release
for release in manifest["releases"]
if release["versionCode"] == version_code
),
None,
)
if name_match is not None:
raise ReleaseNotesError(
f"CI name-only match for {version_name}: entry has versionCode "
f"{name_match['versionCode']}, expected {version_code}"
)
if code_match is not None:
raise ReleaseNotesError(
f"CI code-only match for {version_code}: entry has versionName "
f"{code_match['versionName']}, expected {version_name}"
)
result.update(android=False, intent="desktop-only")
return result
def _load_repo_manifest(repo_root: Path) -> dict[str, Any]:
return load_manifest(repo_root / MANIFEST_PATH)
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("command", choices=("check", "require-current", "ci-intent"))
parser.add_argument("--repo-root", required=True, type=Path)
args = parser.parse_args(argv)
try:
manifest = _load_repo_manifest(args.repo_root)
if args.command == "check":
print(f"OK: {args.repo_root / MANIFEST_PATH}")
return 0
version = read_current_version(args.repo_root)
if args.command == "require-current":
release = require_current(manifest, version)
print(
f"OK: current Android release {release['versionName']} "
f"(versionCode={release['versionCode']})"
)
return 0
result = classify_ci_intent(manifest, version)
print(f"version={result['version']}")
if "version_code" in result:
print(f"version_code={result['version_code']}")
print(f"android={str(result['android']).lower()}")
print(f"intent={result['intent']}")
return 0
except ReleaseNotesError as exc:
print(f"FAIL: {exc}", file=sys.stderr)
return 1
if __name__ == "__main__":
sys.exit(main())

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,19 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20502,
"versionName": "2.5.2",
"items": {
"en": [
"",
" \n\t"
],
"ru": [],
"de": [
" "
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "PASS",
"require_current": "PASS",
"ci_intent": "android",
"version": "2.5.2",
"version_code": 20502,
"android": true,
"kotlin": "safe history",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,14 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20501,
"versionName": "2.5.1",
"items": {
"en": [
"Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "PASS",
"require_current": "FAIL",
"ci_intent": "desktop-only",
"version": "2.5.2",
"version_code": null,
"android": false,
"kotlin": "safe history",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "0.2.0-beta.1"

View file

@ -1,14 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 100,
"versionName": "0.1.0",
"items": {
"en": [
"Earlier Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "PASS",
"require_current": "FAIL",
"ci_intent": "desktop-only",
"version": "0.2.0-beta.1",
"version_code": null,
"android": false,
"kotlin": "safe history",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.3"

View file

@ -1,14 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20502,
"versionName": "2.5.2",
"items": {
"en": [
"Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "PASS",
"require_current": "FAIL",
"ci_intent": "desktop-only",
"version": "2.5.3",
"version_code": null,
"android": false,
"kotlin": "safe history",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.3"

View file

@ -1,23 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20502,
"versionName": "2.5.2",
"items": {
"en": [
"Android change"
]
}
},
{
"versionCode": 20502,
"versionName": "2.5.3",
"items": {
"en": [
"Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "FAIL",
"require_current": "FAIL",
"ci_intent": "FAIL",
"version": "2.5.3",
"version_code": null,
"android": null,
"kotlin": "reject",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,23 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20501,
"versionName": "2.5.2",
"items": {
"en": [
"Android change"
]
}
},
{
"versionCode": 20502,
"versionName": "2.5.2",
"items": {
"en": [
"Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "FAIL",
"require_current": "FAIL",
"ci_intent": "FAIL",
"version": "2.5.2",
"version_code": null,
"android": null,
"kotlin": "reject",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,13 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20502,
"versionName": "2.5.2",
"items": {
"en": ["first"],
"en": ["duplicate key"]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "FAIL",
"require_current": "FAIL",
"ci_intent": "FAIL",
"version": "2.5.2",
"version_code": null,
"android": null,
"kotlin": "no crash",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,10 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20502,
"versionName": "2.5.2",
"items": {}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "PASS",
"require_current": "PASS",
"ci_intent": "android",
"version": "2.5.2",
"version_code": 20502,
"android": true,
"kotlin": "safe history",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "0.2.0-beta.1"

View file

@ -1,14 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 200,
"versionName": "0.2.0-beta.1",
"items": {
"en": [
"Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "FAIL",
"require_current": "FAIL",
"ci_intent": "FAIL",
"version": "0.2.0-beta.1",
"version_code": null,
"android": null,
"kotlin": "reject",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,4 +0,0 @@
{
"schemaVersion": 1,
"releases": {}
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "FAIL",
"require_current": "FAIL",
"ci_intent": "FAIL",
"version": "2.5.2",
"version_code": null,
"android": null,
"kotlin": "reject",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,14 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20502,
"versionName": "2.5.1",
"items": {
"en": [
"Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "FAIL",
"require_current": "FAIL",
"ci_intent": "FAIL",
"version": "2.5.2",
"version_code": null,
"android": null,
"kotlin": "reject",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,15 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20502,
"versionName": "2.5.2",
"items": {
"en": [
"Change",
7
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "FAIL",
"require_current": "FAIL",
"ci_intent": "FAIL",
"version": "2.5.2",
"version_code": null,
"android": null,
"kotlin": "reject",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,14 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20503,
"versionName": "2.5.2",
"items": {
"en": [
"Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "FAIL",
"require_current": "FAIL",
"ci_intent": "FAIL",
"version": "2.5.2",
"version_code": null,
"android": null,
"kotlin": "reject",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,14 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20502,
"versionName": "2.5.3",
"items": {
"en": [
"Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "FAIL",
"require_current": "FAIL",
"ci_intent": "FAIL",
"version": "2.5.2",
"version_code": null,
"android": null,
"kotlin": "reject",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "0.2.0-beta.1"

View file

@ -1,14 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 200,
"versionName": "0.2.0",
"items": {
"en": [
"Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "PASS",
"require_current": "FAIL",
"ci_intent": "desktop-only",
"version": "0.2.0-beta.1",
"version_code": null,
"android": false,
"kotlin": "safe history",
"kotlin_no_crash": true
}

View file

@ -1,2 +0,0 @@
[workspace.package]
version = "2.5.2"

View file

@ -1,23 +0,0 @@
{
"schemaVersion": 1,
"releases": [
{
"versionCode": 20502,
"versionName": "2.5.2",
"items": {
"en": [
"Android change"
]
}
},
{
"versionCode": 20501,
"versionName": "2.5.1",
"items": {
"en": [
"Android change"
]
}
}
]
}

View file

@ -1,10 +0,0 @@
{
"python_gate": "FAIL",
"require_current": "FAIL",
"ci_intent": "FAIL",
"version": "2.5.2",
"version_code": null,
"android": null,
"kotlin": "reject",
"kotlin_no_crash": true
}

Some files were not shown because too many files have changed in this diff Show more