Merge branch 'worktree-agent-a4babc5b5815f6f3a'
69 files+31−35053 files not counted0/69 viewed
| 60 | 60 | - **Why-blame and decisions.** `g1t why file:line` answers why code is as it | |
| 61 | 61 | is: its commit, pull request, issue, the decisions recorded along the way, | |
| 62 | 62 | and the sessions behind it. | |
| 63 | − | - **Memory.** Short notes about a project or workspace that your team and | |
| 64 | − | your agents read before they start and add to as they learn. | |
| 65 | 63 | - **Ask g1t.** Ask about your work from any page, or by messaging @g1t. It | |
| 66 | 64 | answers with your workspace's own AI provider and reads g1t as you. | |
| 67 | 65 |
| 11 | 11 | const SUPPORTED_VERSIONS: [&str; 3] = ["2025-06-18", "2025-03-26", "2024-11-05"]; | |
| 12 | 12 | ||
| 13 | 13 | const INSTRUCTIONS: &str = "g1t is where your code, its history and the work around it live: repositories, issues, pull requests, workflows, deployments and packages. You bring your own agent; these tools are how it reads and changes what is on g1t, as the person or token it acts for. Repositories are named \"owner/name\"; issues and pull requests in one share a sequence of numbers. | |
| 14 | − | Tools are resources, each with an `action`: search, repository, issue, pull_request, session, memory, workflow, observability, package, secret, webhook, access, team, workspace, billing, security, notifications, account, artifact. The `action` field lists each action and the fields it needs. You see only what your token's scopes allow; a refusal names the scope it needs. | |
| 14 | + | Tools are resources, each with an `action`: search, repository, issue, pull_request, session, workflow, observability, package, secret, webhook, access, team, workspace, billing, security, notifications, account, artifact. The `action` field lists each action and the fields it needs. You see only what your token's scopes allow; a refusal names the scope it needs. | |
| 15 | 15 | Find a repository: account whoami lists your workspaces; repository list or search finds one. | |
| 16 | − | Work on an issue: issue work (everything about it: what done means, who is on it, its pull requests, what it waits on), issue claim (advisory: it tells you who else is on it), memory recall, then pull_request create with the issue's number: you get a draft with its own fork to clone and push to. Push your commits, then pull_request ready with a summary. Watch `overlaps` and `behind` on pull_request get, and its checks there: `statuses` from the repository's workflows and `required_checks`, which must pass before it merges. If one fails, read why with workflow get_run and job_logs, push a fix, and the checks run again. | |
| 16 | + | Work on an issue: issue work (everything about it: what done means, who is on it, its pull requests, what it waits on), issue claim (advisory: it tells you who else is on it), then pull_request create with the issue's number: you get a draft with its own fork to clone and push to. Push your commits, then pull_request ready with a summary. Watch `overlaps` and `behind` on pull_request get, and its checks there: `statuses` from the repository's workflows and `required_checks`, which must pass before it merges. If one fails, read why with workflow get_run and job_logs, push a fix, and the checks run again. | |
| 17 | 17 | Coordinate: session start once per run of your harness (harness_session_id makes it idempotent), session update as a heartbeat, session record your prompts and tool calls, session end when done; issue release or handoff (with a note) when you stop. | |
| 18 | 18 | Record your session: as you work, pull_request record_session appends your prompts, reasoning and the tools you ran to the pull request's session, so reviewers see why the change is what it is; pull_request read_session reads it back. pull_request record_decision keeps a decision (why the change is made this way, or what fixed a failure) and list_decisions reads them; repository why says why a line of code is the way it is. | |
| 19 | 19 | Merge queue: when your pull request fails combined with the ones ahead of it, g1t says which of them it breaks with and the check that failed (on the pull request, its issue and its session, and as integration.failed). Fix it and push: once its checks pass, it rejoins the queue by itself. | |
| 20 | − | Memory: memory recall before you start to learn how the project builds and what it has decided; when you learn something the next agent needs, memory remember it, one short fact at a time (scope project or workspace). Never a secret. | |
| 21 | 20 | Security: security code_alerts, vulnerability_alerts and secret_alerts show what to fix; fix it in your pull request, which the Code scanning and Dependency review checks judge. | |
| 22 | 21 | Production: observability overview and errors show what a project's running software did; follow a request or trace to its logs."; | |
| 23 | 22 |
| 411 | 411 | &[Op::ListDecisions, Op::RecordDecision, Op::Why], | |
| 412 | 412 | ), | |
| 413 | 413 | ( | |
| 414 | − | "Memory", | |
| 415 | − | "What agents and people learned that the next agent should know, for one project or across a workspace. Members only; never a secret.", | |
| 416 | − | &[Op::Remember, Op::Recall], | |
| 417 | − | ), | |
| 418 | − | ( | |
| 419 | 414 | "Search", | |
| 420 | 415 | "One search across all of g1t: repositories, code, issues, pull requests, people and workspaces. Public content for everyone, and private content in workspaces you belong to.", | |
| 421 | 416 | &[Op::Search], | |
| ⋯ | |||
| 667 | 662 | Op::UpdateRepoSettings => "Update repository settings", | |
| 668 | 663 | Op::ListCheckNames => "List check names", | |
| 669 | 664 | Op::GetMergeQueue => "Get the merge queue", | |
| 670 | − | Op::Remember => "Remember something", | |
| 671 | − | Op::Recall => "Recall memory", | |
| 672 | 665 | Op::Search => "Search g1t", | |
| 673 | 666 | Op::ListIssues => "List issues", | |
| 674 | 667 | Op::GetIssue => "Get an issue", | |
| 157 | 157 | UpdateRepoSettings, | |
| 158 | 158 | ListCheckNames, | |
| 159 | 159 | GetMergeQueue, | |
| 160 | − | Remember, | |
| 161 | − | Recall, | |
| 162 | 160 | Search, | |
| 163 | 161 | ListIssues, | |
| 164 | 162 | GetIssue, | |
| ⋯ | |||
| 704 | 702 | } | |
| 705 | 703 | ||
| 706 | 704 | impl Op { | |
| 707 | − | pub const ALL: [Op; 380] = [ | |
| 705 | + | pub const ALL: [Op; 378] = [ | |
| 708 | 706 | Op::Whoami, | |
| 709 | 707 | Op::GetWorkspace, | |
| 710 | 708 | Op::CreateWorkspace, | |
| ⋯ | |||
| 750 | 748 | Op::UpdateRepoSettings, | |
| 751 | 749 | Op::ListCheckNames, | |
| 752 | 750 | Op::GetMergeQueue, | |
| 753 | − | Op::Remember, | |
| 754 | − | Op::Recall, | |
| 755 | 751 | Op::Search, | |
| 756 | 752 | Op::ListIssues, | |
| 757 | 753 | Op::GetIssue, | |
| ⋯ | |||
| 1138 | 1134 | Op::GetRepoSettings => "get_repo_settings", | |
| 1139 | 1135 | Op::ListCheckNames => "list_check_names", | |
| 1140 | 1136 | Op::GetMergeQueue => "get_merge_queue", | |
| 1141 | − | Op::Remember => "remember", | |
| 1142 | − | Op::Recall => "recall", | |
| 1143 | 1137 | Op::Search => "search", | |
| 1144 | 1138 | Op::UpdateRepoSettings => "update_repo_settings", | |
| 1145 | 1139 | Op::ListIssues => "list_issues", | |
| ⋯ | |||
| 1423 | 1417 | } | |
| 1424 | 1418 | Op::ListCheckNames => { | |
| 1425 | 1419 | "The check names reported on a repository's commits in the last 30 days, most recent first, with the events each was reported for: the names update_repo_settings takes in required_checks. A workflow's runs report a check named after the workflow; a check required on the default branch must be reported on a pull request's head (pull_request events) and, with the merge queue on, on its queued state (merge_group events)." | |
| 1426 | − | } | |
| 1427 | − | Op::Remember => { | |
| 1428 | − | "Save something to memory that the next agent working here should know: how to build or test, a convention, a decision and why, a trap. scope project is for this codebase; scope workspace is for what holds across all of the workspace's projects, such as \"we use pnpm everywhere\" or where staging lives. One short fact per memory. Never save a secret, key, token or password: text that looks like one is refused. Members of the workspace only." | |
| 1429 | 1420 | } | |
| 1430 | − | Op::Recall => { | |
| 1431 | − | "Search what the project and its workspace remember, by words in any order, or list it all without a query. Pinned memories come first, then the most recently used. Members of the workspace only." | |
| 1432 | − | } | |
| 1433 | 1421 | Op::Search => { | |
| 1434 | 1422 | "Search all of g1t: repositories (name, description, topics, README), code on default branches (file names and contents), issues, pull requests, people and workspaces. Covers everything public, and private content in workspaces you belong to; signed out, public only. Write words, \"exact phrases\", -words to leave out, and qualifiers: repo:owner/name, org:workspace, language:rust, path:src/ (a glob with *), is:issue, is:pr, is:open, is:closed, is:merged, author:username, label:bug. type picks the kind of results (repositories, code, issues, pulls or people); without it, the qualifiers decide. Returns one page of results with the matches highlighted, code with line numbers, and how many there are of each kind." | |
| 1435 | 1423 | } | |
| ⋯ | |||
| 2220 | 2208 | Op::ListDeletedRepos => object(json!({ "workspace": workspace_schema() }), &["workspace"]), | |
| 2221 | 2209 | Op::GetRepoSettings | Op::ListCheckNames => object(json!({ "repo": repo_schema() }), &["repo"]), | |
| 2222 | 2210 | Op::GetMergeQueue => object(json!({ "repo": repo_schema() }), &["repo"]), | |
| 2223 | − | Op::Remember => object( | |
| 2224 | − | json!({ | |
| 2225 | − | "repo": repo_schema(), | |
| 2226 | − | "text": { "type": "string", "description": "What to remember, in one or two sentences. At most 1000 characters." }, | |
| 2227 | − | "scope": { | |
| 2228 | − | "type": "string", | |
| 2229 | − | "enum": ["project", "workspace"], | |
| 2230 | − | "description": "project: about this codebase. workspace: true across the workspace's projects. Defaults to project.", | |
| 2231 | − | }, | |
| 2232 | − | "kind": { | |
| 2233 | − | "type": "string", | |
| 2234 | − | "enum": ["fact", "convention", "decision", "gotcha"], | |
| 2235 | − | "description": "Defaults to fact.", | |
| 2236 | − | }, | |
| 2237 | − | "from_number": { | |
| 2238 | − | "type": "integer", | |
| 2239 | − | "description": "For an agent: the pull request you are working on, recorded as where it was learned.", | |
| 2240 | − | }, | |
| 2241 | − | }), | |
| 2242 | − | &["repo", "text"], | |
| 2243 | − | ), | |
| 2244 | − | Op::Recall => object( | |
| 2245 | − | json!({ | |
| 2246 | − | "repo": repo_schema(), | |
| 2247 | − | "query": { "type": "string", "description": "Words to look for. Leave out for everything." }, | |
| 2248 | − | "limit": { "type": "integer", "description": "At most 100 of each level; 20 if not given." }, | |
| 2249 | − | }), | |
| 2250 | − | &["repo"], | |
| 2251 | − | ), | |
| 2252 | 2211 | Op::Search => object( | |
| 2253 | 2212 | json!({ | |
| 2254 | 2213 | "query": { "type": "string", "description": "What to look for: words, \"phrases\" and qualifiers, such as parse_query language:rust repo:acme/web." }, | |
| ⋯ | |||
| 4209 | 4168 | } | |
| 4210 | 4169 | Op::GetMergeQueue => { | |
| 4211 | 4170 | pass(work, "queue", &json!({ "repo": repo, "viewer": viewer })).await | |
| 4212 | − | } | |
| 4213 | − | Op::Remember => { | |
| 4214 | − | let scope = match input["scope"].as_str() { | |
| 4215 | − | Some("workspace") => "workspace", | |
| 4216 | − | None | Some("project") => "project", | |
| 4217 | − | Some(_) => return failed(FailureCode::Invalid, "scope must be project or workspace."), | |
| 4218 | − | }; | |
| 4219 | − | let kind = input["kind"].as_str().unwrap_or("fact"); | |
| 4220 | − | if g1t_contracts::agents::MemoryKind::parse(kind).is_none() { | |
| 4221 | − | return failed(FailureCode::Invalid, "kind must be fact, convention, decision or gotcha."); | |
| 4222 | − | } | |
| 4223 | − | pass( | |
| 4224 | − | work, | |
| 4225 | − | "add_memory", | |
| 4226 | − | &json!({ | |
| 4227 | − | "actor": actor(), | |
| 4228 | − | "workspace": repo.namespace.to_lowercase(), | |
| 4229 | − | "repo": repo, | |
| 4230 | − | "scope": scope, | |
| 4231 | − | "text": text(input, "text"), | |
| 4232 | − | "kind": kind, | |
| 4233 | − | "fromNumber": integer(input, "from_number"), | |
| 4234 | − | }), | |
| 4235 | − | ) | |
| 4236 | − | .await | |
| 4237 | 4171 | } | |
| 4238 | 4172 | Op::Search => { | |
| 4239 | 4173 | pass( | |
| ⋯ | |||
| 4247 | 4181 | }), | |
| 4248 | 4182 | "page": integer(input, "page"), | |
| 4249 | 4183 | "perPage": integer(input, "per_page"), | |
| 4250 | − | }), | |
| 4251 | − | ) | |
| 4252 | − | .await | |
| 4253 | − | } | |
| 4254 | − | Op::Recall => { | |
| 4255 | − | pass( | |
| 4256 | − | work, | |
| 4257 | − | "recall", | |
| 4258 | − | &json!({ | |
| 4259 | − | "viewer": viewer, | |
| 4260 | − | "repo": repo, | |
| 4261 | − | "query": optional_text(input, "query"), | |
| 4262 | − | "limit": integer(input, "limit"), | |
| 4263 | 4184 | }), | |
| 4264 | 4185 | ) | |
| 4265 | 4186 | .await | |
| 4828 | 4828 | }, | |
| 4829 | 4829 | "notes": "`created` is false when the ticket was imported before; `number` is then that issue." | |
| 4830 | 4830 | }, | |
| 4831 | − | "remember": { | |
| 4832 | − | "request": { | |
| 4833 | − | "text": "The tests need TZ=UTC or the date tests fail.", | |
| 4834 | − | "scope": "project", | |
| 4835 | − | "kind": "gotcha", | |
| 4836 | − | "from_number": 14 | |
| 4837 | − | }, | |
| 4838 | − | "response": { | |
| 4839 | − | "id": "mem_01m43v8q2w3e4r5t6y7u8i9o0p", | |
| 4840 | − | "scope": "project", | |
| 4841 | − | "workspace": "flagon-io", | |
| 4842 | − | "repo": { | |
| 4843 | − | "namespace": "flagon-io", | |
| 4844 | − | "name": "hello" | |
| 4845 | − | }, | |
| 4846 | − | "text": "The tests need TZ=UTC or the date tests fail.", | |
| 4847 | − | "kind": "gotcha", | |
| 4848 | − | "source": { | |
| 4849 | − | "kind": "run", | |
| 4850 | − | "run_id": "arn_01m43v2c1p9k8d7e6f5a4b3c2d", | |
| 4851 | − | "repo": { | |
| 4852 | − | "namespace": "flagon-io", | |
| 4853 | − | "name": "hello" | |
| 4854 | − | }, | |
| 4855 | − | "number": 14 | |
| 4856 | − | }, | |
| 4857 | − | "created_by": "g1t", | |
| 4858 | − | "pinned": false, | |
| 4859 | − | "created_at": "2026-10-01T18:40:12.000Z", | |
| 4860 | − | "updated_at": "2026-10-01T18:40:12.000Z", | |
| 4861 | − | "last_used_at": null | |
| 4862 | − | }, | |
| 4863 | − | "notes": "Text that looks like a key, a token or a password is refused with `invalid`: memory is read by every agent in the workspace. Saving the same text again in the same scope returns the memory already kept." | |
| 4864 | − | }, | |
| 4865 | − | "recall": { | |
| 4866 | − | "query": { | |
| 4867 | − | "q": "pnpm" | |
| 4868 | − | }, | |
| 4869 | − | "response": { | |
| 4870 | − | "project": [], | |
| 4871 | − | "workspace": [ | |
| 4872 | − | { | |
| 4873 | − | "id": "mem_01m43t0a1s2d3f4g5h6j7k8l9z", | |
| 4874 | − | "scope": "workspace", | |
| 4875 | − | "workspace": "flagon-io", | |
| 4876 | − | "repo": null, | |
| 4877 | − | "text": "We use pnpm everywhere, never npm or yarn.", | |
| 4878 | − | "kind": "convention", | |
| 4879 | − | "source": { | |
| 4880 | − | "kind": "person", | |
| 4881 | − | "run_id": null, | |
| 4882 | − | "repo": null, | |
| 4883 | − | "number": null | |
| 4884 | − | }, | |
| 4885 | − | "created_by": "syntaqx", | |
| 4886 | − | "pinned": true, | |
| 4887 | − | "created_at": "2026-10-01T18:40:12.000Z", | |
| 4888 | − | "updated_at": "2026-10-01T18:40:12.000Z", | |
| 4889 | − | "last_used_at": null | |
| 4890 | − | } | |
| 4891 | − | ] | |
| 4892 | − | }, | |
| 4893 | − | "notes": "Anyone who can read the repository gets its project memory; `workspace` is filled only for members of the workspace, and is empty for anyone else. Each memory returned is marked used, which keeps it near the front of what agents are given." | |
| 4894 | − | }, | |
| 4895 | 4831 | "search": { | |
| 4896 | 4832 | "query": { | |
| 4897 | 4833 | "q": "parse_query language:rust repo:acme/web", |
| 536 | 536 | &[], | |
| 537 | 537 | ), | |
| 538 | 538 | route("GET", "/repos/:owner/:name/queue", Op::GetMergeQueue, &[]), | |
| 539 | − | route("POST", "/repos/:owner/:name/memory", Op::Remember, &[]), | |
| 540 | − | route( | |
| 541 | − | "GET", | |
| 542 | − | "/repos/:owner/:name/memory", | |
| 543 | − | Op::Recall, | |
| 544 | − | &[("q", "query"), ("limit", "limit")], | |
| 545 | − | ), | |
| 546 | 539 | route( | |
| 547 | 540 | "GET", | |
| 548 | 541 | "/repos/:owner/:name/events", |
| 205 | 205 | ], | |
| 206 | 206 | }, | |
| 207 | 207 | Tool { | |
| 208 | − | name: "memory", | |
| 209 | − | title: "Memory", | |
| 210 | − | description: "What the project and its workspace remember for the next agent: how to build, conventions, decisions, traps. Recall before you start; remember one short fact at a time, never a secret.", | |
| 211 | − | default_action: None, | |
| 212 | − | actions: &[ | |
| 213 | − | a("recall", Op::Recall, "Search memory, or list it all"), | |
| 214 | − | a("remember", Op::Remember, "Save one fact"), | |
| 215 | − | ], | |
| 216 | − | }, | |
| 217 | − | Tool { | |
| 218 | 208 | name: "workflow", | |
| 219 | 209 | title: "Workflows", | |
| 220 | 210 | description: "GitHub Actions workflows from .g1t/workflows: their runs, jobs and logs, and running, cancelling or rerunning them. Runs' artifacts: listing, a download link, deleting, and how long they are kept. The repository's actions/cache entries: listing them, what they hold against its 10 GiB, and deleting them. Deployments wherever they run (reported from any CI, made by jobs with an `environment:`, or built on g1t.page), their statuses and environments, and reporting your own; environments' protection rules, approving or rejecting the jobs they hold, approving a pull request's run from outside, the token's default permissions, repository dispatch, and the workflows a workspace runs in its repositories without a file in them. Checks on commits: statuses, check runs (a g1t Actions job is one) and check suites, to read where a commit stands or report on it from CI or an integration. Also the self-hosted runners they run on: a workspace's (`workspace`) or a repository's own (`repo`), and their groups.", | |
| ⋯ | |||
| 955 | 945 | fn a_narrow_token_sees_only_its_tools() { | |
| 956 | 946 | let access = token(Some(vec![Scope::IssuesWrite])); | |
| 957 | 947 | let names: Vec<Value> = listed(&Gate::Token(&access)).into_iter().map(|tool| tool["name"].clone()).collect(); | |
| 958 | − | // Labels and milestones are the repository's, managed with issues:write. | |
| 959 | − | assert_eq!(names, vec![json!("repository"), json!("issue"), json!("account")]); | |
| 948 | + | // Labels and milestones are the repository's, managed with issues:write; | |
| 949 | + | // looking up the ticket an issue refers to is search's. | |
| 950 | + | assert_eq!(names, vec![json!("search"), json!("repository"), json!("issue"), json!("account")]); | |
| 960 | 951 | // Notifications are a resource of their own: reading them lists | |
| 961 | 952 | // only what reads. | |
| 962 | 953 | let reader = token(Some(vec![Scope::NotificationsRead])); | |
| ⋯ | |||
| 978 | 969 | let repository = tools.iter().find(|tool| tool["name"] == "repository").unwrap(); | |
| 979 | 970 | assert_eq!(repository["annotations"]["destructiveHint"], true); | |
| 980 | 971 | assert_eq!(repository["annotations"]["readOnlyHint"], false); | |
| 981 | − | let memory = tools.iter().find(|tool| tool["name"] == "memory").unwrap(); | |
| 982 | − | assert_eq!(memory["annotations"]["destructiveHint"], false); | |
| 972 | + | let session = tools.iter().find(|tool| tool["name"] == "session").unwrap(); | |
| 973 | + | assert_eq!(session["annotations"]["destructiveHint"], false); | |
| 983 | 974 | } | |
| 984 | 975 | ||
| 985 | 976 | #[test] | |
| 20 | 20 | '/guides/agents/': '/guides/bring-your-own-agent/', | |
| 21 | 21 | '/guides/agent-abilities/': '/guides/bring-your-own-agent/', | |
| 22 | 22 | '/guides/agent-access/': '/guides/bring-your-own-agent/', | |
| 23 | − | '/guides/agent-memory/': '/guides/memory/', | |
| 23 | + | '/guides/agent-memory/': '/guides/bring-your-own-agent/', | |
| 24 | 24 | '/guides/agent-routines/': '/guides/bring-your-own-agent/', | |
| 25 | 25 | '/guides/agent-sessions/': '/guides/why-blame/', | |
| 26 | 26 | '/guides/agent-skills/': '/guides/bring-your-own-agent/', | |
| 27 | 27 | '/guides/agent-budgets/': '/guides/usage-and-billing/', | |
| 28 | − | '/guides/agents-and-memory/': '/guides/memory/', | |
| 28 | + | '/guides/agents-and-memory/': '/guides/bring-your-own-agent/', | |
| 29 | 29 | '/guides/talking-to-agents/': '/guides/bring-your-own-agent/', | |
| 30 | 30 | '/guides/chat-app/': '/guides/chat/', | |
| 31 | 31 | '/guides/customize/': '/guides/bring-your-own-agent/', | |
| 32 | 32 | '/guides/marketplace/': '/guides/bring-your-own-agent/', | |
| 33 | 33 | '/guides/models/': '/guides/integrations/', | |
| 34 | 34 | '/guides/ai-gateway/': '/guides/integrations/', | |
| 35 | − | '/guides/context-hub/': '/guides/memory/', | |
| 35 | + | '/guides/context-hub/': '/guides/bring-your-own-agent/', | |
| 36 | + | // Project and workspace memory is gone: harnesses keep their own. | |
| 37 | + | '/guides/memory/': '/guides/bring-your-own-agent/', | |
| 36 | 38 | '/guides/spend/': '/guides/usage-and-billing/', | |
| 37 | 39 | '/guides/outcomes/': '/guides/milestones/', | |
| 38 | 40 | }, | |
| ⋯ | |||
| 156 | 158 | { label: 'Claude Code plugin', slug: 'guides/claude-code-plugin' }, | |
| 157 | 159 | { label: 'Sessions, claims and dependencies', slug: 'guides/sessions' }, | |
| 158 | 160 | { label: 'Sessions and why-blame', slug: 'guides/why-blame' }, | |
| 159 | − | { label: 'Memory', slug: 'guides/memory' }, | |
| 160 | 161 | ], | |
| 161 | 162 | }, | |
| 162 | 163 | { | |
| 778 | 778 | | Workflow files | write | `workflow_files:write` | | |
| 779 | 779 | | Checks and statuses | read, read and write | `checks:read`, `checks:write` | | |
| 780 | 780 | | Deployments | read, read and write | `deployments:read`, `deployments:write` | | |
| 781 | − | | Memory | read, read and write | `memory:read`, `memory:write` | | |
| 782 | 781 | | Who has access | read, admin | `access:read`, `access:admin` | | |
| 783 | 782 | | Webhooks | read, admin | `webhooks:read`, `webhooks:admin` | | |
| 784 | 783 | | Secrets and variables | read, admin | `secrets:read`, `secrets:admin` | | |
| ⋯ | |||
| 834 | 833 | | Preset | Permissions | | |
| 835 | 834 | | --- | --- | | |
| 836 | 835 | | Read only | Every resource at read except Chat. Changes nothing. | | |
| 837 | − | | Agent | Every resource at read except Self-hosted runners and Chat, and Code, Issues, Pull requests, Memory and Notifications at read and write. For a [coding agent](/guides/bring-your-own-agent/): reads everything, works on issues and pull requests, pushes code, and answers your inbox. No admin level. | | |
| 836 | + | | Agent | Every resource at read except Self-hosted runners and Chat, and Code, Issues, Pull requests and Notifications at read and write. For a [coding agent](/guides/bring-your-own-agent/): reads everything, works on issues and pull requests, pushes code, and answers your inbox. No admin level. | | |
| 838 | 837 | | CI | Repositories: read; Code, Packages, Workflows, Checks and statuses, and Deployments: read and write. Clones and pushes code, pushes and pulls packages, runs workflows, and reports [checks](/guides/checks/) and deployments. | | |
| 839 | 838 | ||
| 840 | 839 | **All** is not a preset that grows: it ticks every permission there is | |
| ⋯ | |||
| 879 | 878 | | `checks:write` | Report [statuses and check runs](/guides/checks/) on commits, and ask for checks to run again | | |
| 880 | 879 | | `deployments:read` | See [deployments](/guides/deployments-api/), their statuses and environments | | |
| 881 | 880 | | `deployments:write` | Report deployments and their statuses, from any CI | | |
| 882 | − | | `memory:read` | Recall a project's and the workspace's [memory](/guides/memory/) | | |
| 883 | − | | `memory:write` | Save to a project's or the workspace's memory | | |
| 884 | 881 | | `account:read` | Read your email addresses, invites, invitations, pinned projects and stars | | |
| 885 | 882 | | `account:write` | Change your email addresses, make invites, answer invitations, pin projects and star repositories | | |
| 886 | 883 | | `notifications:read` | See your [notifications](/guides/notifications/), its threads, and what you subscribe to and watch | | |
| ⋯ | |||
| 1005 | 1002 | in [Connected applications](https://g1t.sh/settings/applications) to narrow | |
| 1006 | 1003 | it. | |
| 1007 | 1004 | ||
| 1008 | − | A token or application that was given `agents:run`, `models:read` or | |
| 1009 | − | `models:write` keeps working for its other scopes; those three grant | |
| 1010 | − | nothing. | |
| 1005 | + | A token or application that was given `agents:run`, `memory:read`, | |
| 1006 | + | `memory:write`, `models:read` or `models:write` keeps working for its | |
| 1007 | + | other scopes; those five grant nothing. | |
| 1011 | 1008 | ||
| 1012 | 1009 | The old addresses of the token settings lead to the list and to each | |
| 1013 | 1010 | token's page. | |
| ⋯ | |||
| 1098 | 1095 | ||
| 1099 | 1096 | An application that asks for no scopes in particular gets the | |
| 1100 | 1097 | [Agent preset](#presets): every `read` scope except `runners:read` and `chat:read`, and `code:write`, | |
| 1101 | − | `issues:write`, `pull_requests:write`, `memory:write` and | |
| 1102 | − | `notifications:write`. | |
| 1098 | + | `issues:write`, `pull_requests:write` and `notifications:write`. | |
| 1103 | 1099 | It never gets an admin scope unless it asks for one and you leave it | |
| 1104 | 1100 | ticked, and it gets `chat:read` and `chat:write` only by asking for them; | |
| 1105 | 1101 | with them it can use [Chat](#chat-and-notifications-without-the-website). | |
| 1 | 1 | --- | |
| 2 | 2 | title: Connect a coding agent | |
| 3 | − | description: Connect Claude Code, Codex, Cursor, OpenCode or any MCP client to g1t, and have it work on issues, record its sessions, share memory and react to events. | |
| 3 | + | description: Connect Claude Code, Codex, Cursor, OpenCode or any MCP client to g1t, and have it work on issues, record its sessions and react to events. | |
| 4 | 4 | --- | |
| 5 | 5 | ||
| 6 | 6 | import AgentSetup from '../../../components/AgentSetup.astro'; | |
| ⋯ | |||
| 16 | 16 | | Start the agent when something happens | [Webhooks](/guides/webhooks/), or a [workflow](/guides/actions/) on `issues` or `issue_comment` | | |
| 17 | 17 | | Show people how a change was made | The pull request's [session](/guides/why-blame/#sessions) | | |
| 18 | 18 | | See who is working on what, and not collide | [Sessions, claims and dependencies](/guides/sessions/) | | |
| 19 | − | | Pass what one agent learned to the next | [Memory](/guides/memory/) | | |
| 20 | 19 | | Script anything else | The [REST API](/reference/api/), which has the same operations as the tools | | |
| 21 | 20 | ||
| 22 | 21 | The agent runs where you run it: on your machine, in your CI, or on a | |
| ⋯ | |||
| 62 | 61 | ||
| 63 | 62 | | Choose | For an agent | | |
| 64 | 63 | | --- | --- | | |
| 65 | − | | Scopes | The **Agent** preset: reading across g1t, and writing code, issues, pull requests, memory and notifications. Add an admin scope only for a task that needs it. | | |
| 64 | + | | Scopes | The **Agent** preset: reading across g1t, and writing code, issues, pull requests and notifications. Add an admin scope only for a task that needs it. | | |
| 66 | 65 | | Expires | The shortest that fits the work, such as 30 days. | | |
| 67 | 66 | ||
| 68 | 67 | A token reaches every workspace and repository you can. To keep an agent | |
| ⋯ | |||
| 82 | 81 | done means, who has claimed it, the pull requests already made for it, | |
| 83 | 82 | and what it is blocked by. Then `issue` with `claim`, which also says | |
| 84 | 83 | who else is on it. | |
| 85 | − | 2. `memory` with `recall`, to read what the project remembers: how to | |
| 86 | − | build, conventions and traps. | |
| 87 | − | 3. `pull_request` with `create` and the issue's number. This opens a draft | |
| 84 | + | 2. `pull_request` with `create` and the issue's number. This opens a draft | |
| 88 | 85 | pull request and returns the git remote of its fork. | |
| 89 | − | 4. Clone the fork, make changes, commit and push. | |
| 90 | − | 5. `pull_request` with `record_session` as it goes, so people can see its | |
| 86 | + | 3. Clone the fork, make changes, commit and push. | |
| 87 | + | 4. `pull_request` with `record_session` as it goes, so people can see its | |
| 91 | 88 | reasoning. | |
| 92 | − | 6. `pull_request` with `get`, to check `overlaps`, `behind` and the checks. | |
| 93 | − | 7. `pull_request` with `ready` and a summary of what changed and why. | |
| 89 | + | 5. `pull_request` with `get`, to check `overlaps`, `behind` and the checks. | |
| 90 | + | 6. `pull_request` with `ready` and a summary of what changed and why. | |
| 94 | 91 | ||
| 95 | 92 | ### Work with no issue yet | |
| 96 | 93 | ||
| ⋯ | |||
| 151 | 148 | ```md title="AGENTS.md" | |
| 152 | 149 | ## Working on g1t | |
| 153 | 150 | ||
| 154 | − | - Before starting, call g1t's `memory` tool with `recall`. Save anything | |
| 155 | − | the next agent should know with `remember`, one fact at a time. | |
| 156 | 151 | - Work in a draft pull request (`pull_request` `create` with the issue), | |
| 157 | 152 | and record your session with `record_session` before each push. | |
| 158 | 153 | - Read `overlaps` and `behind` on `pull_request` `get` before going far. | |
| 154 | + | - Say why you made a choice with `pull_request` `record_decision`. | |
| 159 | 155 | ``` | |
| 160 | 156 | ||
| 161 | 157 | An agent with a shell can use the [g1t CLI](/guides/cli/) instead of the | |
| ⋯ | |||
| 200 | 196 | Other agents record a session with the same CLI commands, from their | |
| 201 | 197 | instructions file: see | |
| 202 | 198 | [other coding agents](/guides/claude-code-plugin/#other-coding-agents). | |
| 203 | − | ||
| 204 | − | ## Share what agents learn | |
| 205 | 199 | ||
| 206 | − | [Memory](/guides/memory/) holds short notes about a project, or a whole | |
| 207 | − | workspace, that whoever works on it next should know. An agent reads it | |
| 208 | − | with `memory` `recall` before it starts and adds to it with `remember` | |
| 209 | − | when it learns something, such as a test that needs `TZ=UTC`. People see, | |
| 210 | − | pin, edit and forget the same notes on the repository's **Memory** page. | |
| 211 | − | Memory never holds a secret: text that looks like one is refused. | |
| 212 | − | ||
| 213 | 200 | ## Staying out of each other's way | |
| 214 | 201 | ||
| 215 | 202 | Several agents, and people, can work on one repository at once. | |
| ⋯ | |||
| 313 | 300 | | `issue` | Issues, labels and comments; an issue's whole context, and claims | | |
| 314 | 301 | | `pull_request` | Pull requests: create, record and read sessions, review, merge, the merge queue | | |
| 315 | 302 | | `session` | Your harness's session: start, update, record, end, get, list; dispatch work on an issue; who else is working | | |
| 316 | − | | `memory` | `recall` and `remember` | | |
| 317 | 303 | | `workflow` | Workflow runs and logs, checks, deployments, environments and runners | | |
| 318 | 304 | | `observability` | A project's requests, logs, traces, errors and metrics in production | | |
| 319 | 305 | | `package` | Packages in every registry | | |
| 147 | 147 | **Failed**. Skipped builds are left out. A workspace whose projects did not | |
| 148 | 148 | build in the span has no Deploys card. | |
| 149 | 149 | ||
| 150 | − | ### Decisions | |
| 151 | − | ||
| 152 | − | Decisions recorded in the workspace's [memory](/guides/memory/) in the | |
| 153 | − | span, with who recorded each. With none, the card is not shown. | |
| 154 | − | ||
| 155 | 150 | ### Spent | |
| 156 | 151 | ||
| 157 | 152 | What the workspace spent over the span, from its | |
| ⋯ | |||
| 187 | 182 | repositories. | |
| 188 | 183 | - Where you're needed has no rows from Code, and no notifications about a | |
| 189 | 184 | repository. | |
| 190 | − | - Landed, Deploys, memory decisions and Running now are not shown. | |
| 185 | + | - Landed, Deploys and Running now are not shown. | |
| 191 | 186 | - Spent is the same for every member. | |
| 192 | 187 | ||
| 193 | 188 | ## When something doesn't answer | |
| 1 | − | --- | |
| 2 | − | title: Memory | |
| 3 | − | description: Short notes about a project or a whole workspace that your team and your coding agents read before they start and add to as they learn. | |
| 4 | − | --- | |
| 5 | − | ||
| 6 | − | Memory is what someone working on a project should know before they start: | |
| 7 | − | how to build it, its conventions, the decisions behind it and its traps. | |
| 8 | − | People write it on g1t, and your coding agents read and add to it through | |
| 9 | − | the [`memory` tool](/reference/mcp/#memory) or the API, so what one agent | |
| 10 | − | learns the next one starts with. | |
| 11 | − | ||
| 12 | − | | You want to | Go to | | |
| 13 | − | | --- | --- | | |
| 14 | − | | Read or change what a project remembers | The repository's **Memory** page, `g1t.sh/<workspace>/<repo>/memory` | | |
| 15 | − | | Read or change what holds in every project | **Workspace memory**, `g1t.sh/<workspace>/-/memory` | | |
| 16 | − | | Have your agent read memory before it starts | `memory` with `recall` | | |
| 17 | − | | Have your agent save what it learned | `memory` with `remember` | | |
| 18 | − | ||
| 19 | − | ## Two levels | |
| 20 | − | ||
| 21 | − | **Project memory** is about one project's code: | |
| 22 | − | ||
| 23 | − | - how to build and test it: "Run `npm run db:reset` before the integration | |
| 24 | − | tests"; | |
| 25 | − | - its conventions: "Components live in `src/components/ui`; import from | |
| 26 | − | there, not from radix-ui"; | |
| 27 | − | - decisions and why: "We keep the v1 webhook payload; two customers still | |
| 28 | − | parse it"; | |
| 29 | − | - its traps: "The date tests fail unless `TZ=UTC`". | |
| 30 | − | ||
| 31 | − | **Workspace memory** is true across all of the workspace's projects: | |
| 32 | − | ||
| 33 | − | - "We use pnpm everywhere, never npm or yarn"; | |
| 34 | − | - "Staging lives at staging.example.com and deploys from main"; | |
| 35 | − | - "Every service logs JSON to stdout"; | |
| 36 | − | - "Ask Ana before changing anything under billing". | |
| 37 | − | ||
| 38 | − | Put something in workspace memory only when it holds in every project. When | |
| 39 | − | it is true of one codebase, it belongs to that project. | |
| 40 | − | ||
| 41 | − | Each memory has a **kind**: `fact` (the default), `convention`, `decision` | |
| 42 | − | or `gotcha`. | |
| 43 | − | ||
| 44 | − | ## From your coding agent | |
| 45 | − | ||
| 46 | − | An agent connected over [MCP](/guides/bring-your-own-agent/) uses the | |
| 47 | − | `memory` tool: | |
| 48 | − | ||
| 49 | − | - **`recall`** before it starts: the project's memory and, for members of | |
| 50 | − | the workspace, the workspace's, pinned memories first, then the most | |
| 51 | − | recently used. `query` matches every word in any order; leave it out to | |
| 52 | − | list everything. `limit` caps each level, 20 by default and at most 100. | |
| 53 | − | - **`remember`** when it learns something the next agent should know: one | |
| 54 | − | short fact per call, at most 1,000 characters. `scope` is `project` (the | |
| 55 | − | default) or `workspace`, and `kind` is one of the four kinds above. | |
| 56 | − | `from_number` records the pull request it was working on as where the | |
| 57 | − | memory came from. | |
| 58 | − | ||
| 59 | − | ```json | |
| 60 | − | { "name": "memory", "arguments": { "action": "remember", "repo": "acme/web", | |
| 61 | − | "text": "The date tests fail unless TZ=UTC.", "kind": "gotcha", "from_number": 14 } } | |
| 62 | − | ``` | |
| 63 | − | ||
| 64 | − | The same over REST: | |
| 65 | − | ||
| 66 | − | ```sh | |
| 67 | − | curl -X POST https://api.g1t.sh/repos/acme/web/memory \ | |
| 68 | − | -H "Authorization: Bearer $G1T_TOKEN" \ | |
| 69 | − | -H "Content-Type: application/json" \ | |
| 70 | − | -d '{"text": "The date tests fail unless TZ=UTC.", "kind": "gotcha"}' | |
| 71 | − | ||
| 72 | − | curl "https://api.g1t.sh/repos/acme/web/memory?q=tests" \ | |
| 73 | − | -H "Authorization: Bearer $G1T_TOKEN" | |
| 74 | − | ``` | |
| 75 | − | ||
| 76 | − | Reading needs the `memory:read` scope, and saving `memory:write`. Every | |
| 77 | − | memory a `recall` returns counts as used, which keeps it near the front of | |
| 78 | − | what the next `recall` returns. | |
| 79 | − | ||
| 80 | − | Tell your agent to treat memory as notes from colleagues: usually right, | |
| 81 | − | sometimes out of date, and where it disagrees with the code, the code wins. | |
| 82 | − | A line in your repository's `AGENTS.md` or `CLAUDE.md` is enough, such as | |
| 83 | − | "Before starting, call g1t's `memory` tool with `recall`; save anything the | |
| 84 | − | next agent should know with `remember`." | |
| 85 | − | ||
| 86 | − | ## Curate it | |
| 87 | − | ||
| 88 | − | Memory is only as good as it is true. On a project's **Memory** page, | |
| 89 | − | anyone with the Write [role](/guides/access-and-roles/) or higher on its | |
| 90 | − | repository can, and on **Workspace memory**, members can: | |
| 91 | − | ||
| 92 | − | - **add** a memory, with its kind; | |
| 93 | − | - **pin** one, so it comes first in every `recall`; | |
| 94 | − | - **edit** one that has drifted, or change its kind; | |
| 95 | − | - **forget** one that no longer holds. | |
| 96 | − | ||
| 97 | − | Each shows who added it and when, and when it was last recalled. A memory | |
| 98 | − | nobody has recalled for a long time is a good one to check. Saving the same | |
| 99 | − | text twice keeps one memory. A project or a workspace keeps up to 500. | |
| 100 | − | ||
| 101 | − | For members, a project's Memory page also lists the workspace's memory, | |
| 102 | − | read-only; manage it from **Workspace memory**. | |
| 103 | − | ||
| 104 | − | ## Who can see it | |
| 105 | − | ||
| 106 | − | | Memory | Who reads it | Who changes it | | |
| 107 | − | | --- | --- | --- | | |
| 108 | − | | A project's | Anyone who can read its repository: for a public one, anyone | Write or higher on the repository | | |
| 109 | − | | The workspace's | Members of the workspace | Members of the workspace | | |
| 110 | − | ||
| 111 | − | Since a public project's memory can be read by anyone, keep what the | |
| 112 | − | workspace keeps to itself in workspace memory, or in a private project. An | |
| 113 | − | agent's token reads only what the person it acts for can read. | |
| 114 | − | ||
| 115 | − | ## Never a secret | |
| 116 | − | ||
| 117 | − | Memory is read by everyone who can see it and by their agents, so it never | |
| 118 | − | holds a secret. g1t refuses text that looks like one: a key or token with a | |
| 119 | − | known prefix (such as `sk-`, `ghp_`, `AKIA` or `g1t_`), a private key, a | |
| 120 | − | URL with a password in it, `password=` or `token:` followed by a value, or | |
| 121 | − | a long random string. Say where the secret lives instead: "The deploy key | |
| 122 | − | is the `DEPLOY_KEY` secret". Workflows read secrets from | |
| 123 | − | [secrets and variables](/guides/secrets-and-variables/), never from memory. |
| 102 | 102 | ||
| 103 | 103 | The approval page lists what the app asks for: reading your account, | |
| 104 | 104 | workspaces, repositories, checks and workflows, reading and writing | |
| 105 | − | issues, pull requests and notifications, recalling memory, and reading | |
| 106 | − | artifacts. Untick what you would rather it | |
| 105 | + | issues, pull requests and notifications, and reading artifacts. Untick what you would rather it | |
| 107 | 106 | could not do. | |
| 108 | 107 | ||
| 109 | 108 | **Use an access token** signs in with a |
| 165 | 165 | With a token, private results in your workspaces are included. See | |
| 166 | 166 | [Search g1t](/reference/api/search/search/) in the API reference and | |
| 167 | 167 | [MCP tools](/reference/mcp/#search). | |
| 168 | − | ||
| 169 | − | `search` looks across all of g1t. To read what a project or workspace | |
| 170 | − | remembers, use the `memory` tool's `recall` action; see | |
| 171 | − | [Memory](/guides/memory/). |
| 69 | 69 | | Issues and pull requests | With their numbers, comments, reviews, labels, sessions and merge queue. | | |
| 70 | 70 | | Workflows | Workflow runs, their jobs, logs and artifacts. | | |
| 71 | 71 | | Deployments | The repository's project, its deployments and its custom domains. See [deployments](#deployments). | | |
| 72 | − | | Its own settings | Merge rules, branch protection, guardrails, and the project's memory. | | |
| 72 | + | | Its own settings | Merge rules, branch protection and guardrails. | | |
| 73 | 73 | | Its own secrets and variables | Set on the repository, they move with it. | | |
| 74 | 74 | | Its own webhooks | They now name the repository by its new path. | | |
| 75 | 75 | ||
| ⋯ | |||
| 80 | 80 | | Workspace secrets and variables | The old workspace's stop reaching the repository; the new workspace's start, if they reach every repository or name this one. | | |
| 81 | 81 | | Workspace webhooks | The old workspace's stop hearing about the repository; the new one's start. | | |
| 82 | 82 | | Integrations | Sentry, Datadog, Jira and Linear connections stay with their workspace. Connect them in the new one if you need them there. | | |
| 83 | − | | Workspace memory and guardrails | The new workspace's apply from now on. | | |
| 83 | + | | Workspace guardrails | The new workspace's apply from now on. | | |
| 84 | 84 | | The audit log | What happened before the transfer stays in the old workspace's log. Each workspace's log records the transfer itself. | | |
| 85 | 85 | | Billing history | See [billing](#billing). | | |
| 86 | 86 | ||
| 292 | 292 | | Repositories | Purged, their git data with them, including any that were in Recently deleted. | | |
| 293 | 293 | | Projects, apps and custom domains | Removed. | | |
| 294 | 294 | | Webhooks, integrations, secrets and variables | The workspace's own are removed. | | |
| 295 | − | | Memory and guardrails | The workspace's own are removed. | | |
| 295 | + | | Guardrails | The workspace's own are removed. | | |
| 296 | 296 | | Statements, invoices and the ledger | Kept, for accounting. | | |
| 297 | 297 | | The audit log | Kept as [long as its account keeps it](/guides/audit-log/#how-long-it-is-kept), with the purge as its last entry: once the plan ends with the workspace, that is 7 days, unless an enterprise pays for it or longer was arranged. With no owners left, ask support@g1t.sh for an export. | | |
| 298 | 298 | | Old addresses | Redirects for repositories transferred out keep working. The workspace's own pages answer 404. | |
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…
Loading the diff…