Repository navigation
feat: environment variables, a project settings page and a default program per project - #117
Merged
Merged
Conversation
Adds the EnvOp (list, set, remove) and the name and value checks, a project program column with its SetProgram op, and a ProgramOp scope for the project's default.
Variables live in one 0600 file in the data folder, never in the database or a reply. A program gets the global ones and its project's, with the project's winning, before kagan's own KG_* names. A removed project takes its values with it. A project's installed program is the new-thread default.
A value comes from stdin or a prompt that does not show it, and is never taken from the command line.
General lists the variables every program gets. A project's menu opens its page, which holds its variables, its default program, and a spot for agent rules. New threads in that project start with the default when it is installed.
Decisions 211 and 212 say why values sit in a 0600 file and why the project page is its own window page. The product Rust ceiling rises by the 813 lines this feature needs.
The sidebar's Project settings item and kg settings project send the op, so the page is reachable by agents and tests too. A project id that is not live is refused. A new thread's default program can come from a project that is not in the program list, because it is listed as a recent program.
Setup and teardown scripts run with kagan's own environment, so they do not get the variables yet. The page op is in behaviour and decision 212.
Renumbers the environment variable and project page decisions to 220 and 221, puts the project page's agent rules on the shared editor, and gives setup and teardown scripts the same variables.
…dable file aside A request that names a thread cannot set or remove a variable, and the check runs before anything is read. Every read-modify-write holds one lock. An unreadable values file is moved aside on a change and named in a warning; starts still fail with its path. Removing a project forgets its values best-effort. An empty project entry is dropped. Windows names fold case.
The page takes focus when it opens, binds escape, and its Close control matches Settings. A stored program that is not installed is named on the page instead of silently falling back.
… size count The decision now says which requests are refused and that the thread check keys off the op's thread id. It names the Windows ACL, the keychain steps as a list, and the one Cost line with the exact count.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
kg env list,kg env set NAME [--project id](the value comes from stdin or a hidden prompt), andkg env remove. Settings → General has a group for global variables. Values are stored in<data>/environment.json, created with mode 0600. A project's value wins over the global one.kg settings project <id>) opens a window page with the project's variables, its default program, and its agent rules. The rules use the same editor the menu's "Agent rules…" opens.Checked
--no-fail-fast.cargo fmt --check, andcargo clippy --workspace --all-targets --locked -- -D warnings.scripts/smoke.sh.cargo denyandcargo shear, run locally, pass.typospasses. jscpd finds no clone in changed code.Not proven
cfg(unix)where they need unix.KG_THREAD_IDsends. A program can dropKG_THREAD_IDand send the same request. Decision 220 says so.