Skip to content

Derive Sley dirty state from counts#13

Merged
cgraf78 merged 1 commit into
mainfrom
codex/dirty-json-check
Jun 30, 2026
Merged

Derive Sley dirty state from counts#13
cgraf78 merged 1 commit into
mainfrom
codex/dirty-json-check

Conversation

@cgraf78

@cgraf78 cgraf78 commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Derive Sley's dirty-state decision from numeric change counts instead of from
the rendered status JSON string. This keeps machine semantics separate from
display formatting, so changing JSON field order or whitespace cannot change
whether a repo is considered dirty.

Summary

  • split dirty-count collection from JSON rendering
  • derive dirty from staged/pending/unstaged/untracked numeric counts
  • add focused coverage for the count-to-dirty helper

Testing

  • shellcheck lib/sley/sley.sh test/suites/sley-behavior-test
  • bash test/suites/sley-behavior-test

Summary

Separate Sley's dirty-state decision from the display JSON string emitted by
`status`. Dirty state is now derived from numeric staged/pending/unstaged/
untracked counts before rendering JSON, so field order or formatting changes
cannot affect control flow.

Add focused coverage for the count-to-dirty helper to lock in the machine
semantics directly.

Testing

- `shellcheck lib/sley/sley.sh test/suites/sley-behavior-test`
- `bash test/suites/sley-behavior-test`
@cgraf78 cgraf78 merged commit cea3662 into main Jun 30, 2026
6 checks passed
@cgraf78 cgraf78 deleted the codex/dirty-json-check branch June 30, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant