English · Español · 한국어 · 简体中文 · 日本語
Fewer tokens than caveman and ponytail. No accuracy lost.
npx chisle
See both answers
The prompt: "Implement an order state machine covering created, paid, shipped, delivered, cancelled and refunded, with the legal transitions enforced and invalid ones rejected." Excerpts from the verbatim committed answers in raw-nov-sidebyside/large-s2:
| no ruleset: 121 lines, 1,186 answer tokens | Chisle: 62 lines, 530 answer tokens |
|---|---|
class OrderStateError(Exception):
"""Raised when an invalid state transition is attempted."""
pass
class Order:
# Define valid transitions: state -> list of allowed next states
VALID_TRANSITIONS = { … }
def transition_to(self, next_state):
"""Transition to the next state. Raises OrderStateError if invalid."""
def can_transition_to(self, next_state):
"""Check if a transition is allowed without performing it."""…plus usage, tests, printed output and a recap of the transitions. |
class OrderStateMachine:
TRANSITIONS = {
"created": {"pay", "cancel"},
"paid": {"ship", "refund", "cancel"},
…
}
def transition(self, event):
if event not in self.TRANSITIONS[self.state]:
raise ValueError(f"Cannot {event} from {self.state}. …")
self.state = self.STATE_MAP[(self.state, event)]
return self.stateThen a short usage block. |
Every raw transcript is committed, losses included. Method and data · why we publish the losses
Other ways to install
# Claude Code plugin marketplace
claude plugin marketplace add JayPokale/Chisle
claude plugin install chisle@chisle
# curl
curl -fsSL https://raw.githubusercontent.com/JayPokale/Chisle/main/install.sh | bash# Windows
irm https://raw.githubusercontent.com/JayPokale/Chisle/main/install.ps1 | iexPer-agent setup, upgrading and config: docs/usage.md.
⭐ Star the repo: it costs zero tokens.
MIT · Contributing · Began as a merge of caveman and ponytail (notices)