ci / check (push) Canceled after 0s
From an independent review of the round. Spec and CLI together. - A scheduled prompt for a session open in a terminal is judged, then refused (data.reason terminal) instead of being passed to the terminal as a person's turn on the terminal's model. - A schedule's session keeps its model with it: opened from the store again — or in a terminal — it is on the model it had, and stays a schedule's session there (nothing in it becomes the directory's model). - On a refused scheduled turn nothing about the session is changed; a command's interactive-only model in one is the same -32602 with its reason. In a schedule's session a turn a job wakes, and a subagent started with no person's turn running, are still scheduled work. - A rerouted title or summary is counted under the model that was asked and that model is named; a model that cannot take a summary (window too small, no tools) is nowhere to go. - A borrowed model is given back with returnModel, so a command whose model is the session's own leaves nothing borrowed. What is remembered goes through records(), the rule the conformance cases test; a change of model inside a turn the harness started is not remembered. - models.json: a directory's time is refreshed as it is used; a write stats nothing, and gone directories are dropped apart from any turn. - lembas run with no terminal says the way forward, in the refusal and in --help. - Permission rules: a rule written again (the same permission and pattern, later) sets the earlier one aside, as a narrower one does. Cases pin it. - Conformance and the examples use made-up model names. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
668 lines
16 KiB
JSON
668 lines
16 KiB
JSON
{
|
|
"about": "Which permission rule decides (permission/rules.md, spec 3.8.0; rule 2's set-aside 3.9.0). The rules by layer: `defaults` true — permission/defaults.json as the `default` layer; `user` and `project` — a configuration's permission map (a key's value an action, or a map of pattern → action, read in the order written); `made` — rules made during the session, in order, each `by` an `always` answer or a `menu`. With `request` (`permission`, `pattern`: what one call asks for): expect the action that decides, or null where no rule matches. With `set` (a rule a person makes now, by a menu): expect `result` — `unchanged` (the action is already in force), `refused` with the rule in its way as `by`, or `made` with `still`, the stricter narrower rules that still apply, in the order read. The same answers for a rule typed into a file as for one a menu wrote. LLeMbas: security/permission rules; CLI: src/permission/evaluate.ts.",
|
|
"cases": [
|
|
{
|
|
"about": "The defaults alone: a file is read, a .env asks.",
|
|
"defaults": true,
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": "src/app.ts"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "The same, for another call.",
|
|
"defaults": true,
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": "config/.env"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "A project says read: allow. A broader rule made later does not unlock the narrower ask: .env still asks.",
|
|
"defaults": true,
|
|
"project": {
|
|
"read": "allow"
|
|
},
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": ".env"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "…and everything the broad default decided is as the project says.",
|
|
"defaults": true,
|
|
"project": {
|
|
"read": "allow"
|
|
},
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": "notes.txt"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "The same rule set in a menu, in the session it was made in.",
|
|
"defaults": true,
|
|
"made": [
|
|
{
|
|
"permission": "read",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": ".env.local"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "The project names the narrow thing itself: allowed.",
|
|
"defaults": true,
|
|
"project": {
|
|
"read": {
|
|
"*.env": "allow"
|
|
}
|
|
},
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": ".env"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "The broadest rule there is, made in a menu: .env still asks.",
|
|
"defaults": true,
|
|
"made": [
|
|
{
|
|
"permission": "*",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": ".env"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "web_fetch: allow in a project leaves private addresses asking.",
|
|
"defaults": true,
|
|
"project": {
|
|
"web_fetch": "allow"
|
|
},
|
|
"request": {
|
|
"permission": "web_fetch",
|
|
"pattern": "private:http://127.0.0.1:8080/admin"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "The same, for another call.",
|
|
"defaults": true,
|
|
"project": {
|
|
"web_fetch": "allow"
|
|
},
|
|
"request": {
|
|
"permission": "web_fetch",
|
|
"pattern": "https://example.org/"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "The person's own config denies rm; `bash allow` made in a menu does not undo it.",
|
|
"defaults": true,
|
|
"user": {
|
|
"bash": {
|
|
"rm *": "deny"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "bash",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "rm -rf build"
|
|
},
|
|
"expect": "deny"
|
|
},
|
|
{
|
|
"about": "…and allows what only the broad default asked about.",
|
|
"defaults": true,
|
|
"user": {
|
|
"bash": {
|
|
"rm *": "deny"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "bash",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "make all"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "The same from a project's file (the next start, after the menu saved it).",
|
|
"defaults": true,
|
|
"user": {
|
|
"bash": {
|
|
"rm *": "deny"
|
|
}
|
|
},
|
|
"project": {
|
|
"bash": "allow"
|
|
},
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "rm -rf build"
|
|
},
|
|
"expect": "deny"
|
|
},
|
|
{
|
|
"about": "The person's own `git push *`: ask stands against a project's bash: allow.",
|
|
"defaults": true,
|
|
"user": {
|
|
"bash": {
|
|
"git push *": "ask"
|
|
}
|
|
},
|
|
"project": {
|
|
"bash": "allow"
|
|
},
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "git push origin main"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "The person's own answer is a floor of any breadth: their bash: ask stands against a project's narrower allow.",
|
|
"defaults": true,
|
|
"user": {
|
|
"bash": "ask"
|
|
},
|
|
"project": {
|
|
"bash": {
|
|
"make *": "allow"
|
|
}
|
|
},
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "make all"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "The person's own file is read last-match-wins, as it always was: their broad allow after the defaults does unlock .env — it is theirs to say.",
|
|
"defaults": true,
|
|
"user": {
|
|
"read": "allow"
|
|
},
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": ".env"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "Within a project's file too, a narrower stricter line keeps winning over a broader one written after it.",
|
|
"project": {
|
|
"bash": {
|
|
"git push *": "ask",
|
|
"*": "allow"
|
|
}
|
|
},
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "git push origin main"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "A project's narrow allow after its own broad deny is an exception it wrote: allowed.",
|
|
"project": {
|
|
"bash": {
|
|
"*": "deny",
|
|
"git status": "allow"
|
|
}
|
|
},
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "git status"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "An \"always\" answer never undoes a written deny, of any breadth.",
|
|
"project": {
|
|
"bash": {
|
|
"*": "deny"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "bash",
|
|
"pattern": "git status",
|
|
"action": "allow",
|
|
"by": "always"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "git status"
|
|
},
|
|
"expect": "deny"
|
|
},
|
|
{
|
|
"about": "An \"always\" answer for `git *` leaves the narrower `git push --force *`: deny.",
|
|
"user": {
|
|
"bash": {
|
|
"git push --force *": "deny"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "bash",
|
|
"pattern": "git *",
|
|
"action": "allow",
|
|
"by": "always"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "git push --force origin main"
|
|
},
|
|
"expect": "deny"
|
|
},
|
|
{
|
|
"about": "A stricter rule made later always decides.",
|
|
"defaults": true,
|
|
"made": [
|
|
{
|
|
"permission": "read",
|
|
"pattern": "*",
|
|
"action": "deny",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": "src/app.ts"
|
|
},
|
|
"expect": "deny"
|
|
},
|
|
{
|
|
"about": "No rule matches: none decides (the class and the mode do).",
|
|
"user": {
|
|
"bash": {
|
|
"ls *": "allow"
|
|
}
|
|
},
|
|
"request": {
|
|
"permission": "edit",
|
|
"pattern": "a.txt"
|
|
},
|
|
"expect": null
|
|
},
|
|
{
|
|
"about": "Spec 3.9.0: a narrower rule that a later one narrows again does not count. The defaults ask about *.env.* and then allow *.env.example; after a broad allow made in a menu the example file is still read without asking.",
|
|
"defaults": true,
|
|
"made": [
|
|
{
|
|
"permission": "read",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": ".env.example"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "The same under a project's read: allow, in a subdirectory.",
|
|
"defaults": true,
|
|
"project": {
|
|
"read": "allow"
|
|
},
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": "config/.env.example"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "The same under the broadest rule, made by an \"always\" answer.",
|
|
"defaults": true,
|
|
"made": [
|
|
{
|
|
"permission": "*",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "always"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": ".env.example"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "…and the sibling the defaults do not except still asks: only *.env.* speaks of it.",
|
|
"defaults": true,
|
|
"made": [
|
|
{
|
|
"permission": "read",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": ".env.production"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "Order matters as in a file: the narrow allow is read before the ask that takes it in, so nothing is set aside and the ask decides — as it does without the broad rule.",
|
|
"project": {
|
|
"read": {
|
|
"notes.private.md": "allow",
|
|
"*.private.*": "ask"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "read",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": "notes.private.md"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "A later, narrower rule that is stricter is the one that counts just the same.",
|
|
"project": {
|
|
"bash": {
|
|
"git *": "ask",
|
|
"git push --force *": "deny"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "bash",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "git push --force origin main"
|
|
},
|
|
"expect": "deny"
|
|
},
|
|
{
|
|
"about": "Spec 3.9.0: the same rule written again. A project allows *.env, which the defaults ask about; a broad allow made later changes nothing for it — the later of the two identical rules is the one that counts.",
|
|
"defaults": true,
|
|
"project": {
|
|
"read": {
|
|
"*.env": "allow"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "read",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": ".env"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "…and written again stricter — the person allows *.key, the project denies it — the later one counts under the broad allow, as it decides without it.",
|
|
"user": {
|
|
"read": {
|
|
"*.key": "allow"
|
|
}
|
|
},
|
|
"project": {
|
|
"read": {
|
|
"*.key": "deny"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "read",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "read",
|
|
"pattern": "id.key"
|
|
},
|
|
"expect": "deny"
|
|
},
|
|
{
|
|
"about": "A project's deny narrowed by its own later allow: the exception it wrote holds under a broad allow as without one.",
|
|
"project": {
|
|
"bash": {
|
|
"rm *": "deny",
|
|
"rm -i *": "allow"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "bash",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "rm -i notes.txt"
|
|
},
|
|
"expect": "allow"
|
|
},
|
|
{
|
|
"about": "…and what the exception does not take in is still denied.",
|
|
"project": {
|
|
"bash": {
|
|
"rm *": "deny",
|
|
"rm -i *": "allow"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "bash",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "rm notes.txt"
|
|
},
|
|
"expect": "deny"
|
|
},
|
|
{
|
|
"about": "The person's own ask against a project's narrower allow and a broad allow made later: the set-aside never touches rule 3 — it still asks.",
|
|
"defaults": true,
|
|
"user": {
|
|
"bash": "ask"
|
|
},
|
|
"project": {
|
|
"bash": {
|
|
"make *": "allow"
|
|
}
|
|
},
|
|
"made": [
|
|
{
|
|
"permission": "bash",
|
|
"pattern": "*",
|
|
"action": "allow",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"request": {
|
|
"permission": "bash",
|
|
"pattern": "make all"
|
|
},
|
|
"expect": "ask"
|
|
},
|
|
{
|
|
"about": "Choosing the action already in force changes nothing.",
|
|
"defaults": true,
|
|
"set": {
|
|
"permission": "read",
|
|
"pattern": "*",
|
|
"action": "allow"
|
|
},
|
|
"expect": {
|
|
"result": "unchanged"
|
|
}
|
|
},
|
|
{
|
|
"about": "A rule that makes something stricter is made; nothing stricter is left standing.",
|
|
"defaults": true,
|
|
"set": {
|
|
"permission": "read",
|
|
"pattern": "*",
|
|
"action": "ask"
|
|
},
|
|
"expect": {
|
|
"result": "made",
|
|
"still": []
|
|
}
|
|
},
|
|
{
|
|
"about": "A broad allow is made, and says which stricter rules still apply.",
|
|
"defaults": true,
|
|
"made": [
|
|
{
|
|
"permission": "web_fetch",
|
|
"pattern": "*",
|
|
"action": "ask",
|
|
"by": "menu"
|
|
}
|
|
],
|
|
"set": {
|
|
"permission": "web_fetch",
|
|
"pattern": "*",
|
|
"action": "allow"
|
|
},
|
|
"expect": {
|
|
"result": "made",
|
|
"still": [
|
|
{
|
|
"permission": "web_fetch",
|
|
"pattern": "private:*",
|
|
"action": "ask"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"about": "The person's own rule, loosened where it stands: refused, naming it.",
|
|
"user": {
|
|
"bash": {
|
|
"git push *": "ask"
|
|
}
|
|
},
|
|
"set": {
|
|
"permission": "bash",
|
|
"pattern": "git push *",
|
|
"action": "allow"
|
|
},
|
|
"expect": {
|
|
"result": "refused",
|
|
"by": {
|
|
"permission": "bash",
|
|
"pattern": "git push *",
|
|
"action": "ask"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"about": "A narrower allow under a written deny: refused — the deny takes it in whole.",
|
|
"user": {
|
|
"bash": {
|
|
"rm *": "deny"
|
|
}
|
|
},
|
|
"set": {
|
|
"permission": "bash",
|
|
"pattern": "rm -rf build",
|
|
"action": "allow"
|
|
},
|
|
"expect": {
|
|
"result": "refused",
|
|
"by": {
|
|
"permission": "bash",
|
|
"pattern": "rm *",
|
|
"action": "deny"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"about": "A broader allow over the person's narrower deny is made — and the deny still applies.",
|
|
"user": {
|
|
"bash": {
|
|
"rm *": "deny"
|
|
}
|
|
},
|
|
"set": {
|
|
"permission": "bash",
|
|
"pattern": "*",
|
|
"action": "allow"
|
|
},
|
|
"expect": {
|
|
"result": "made",
|
|
"still": [
|
|
{
|
|
"permission": "bash",
|
|
"pattern": "rm *",
|
|
"action": "deny"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|