Repository navigation
Organization server: access model phase 2, run-owner proof, one chats.read - #2890
Merged
Merged
Conversation
GitHub joins the connector catalog (Featured first): device-flow sign-in with the WorkAF OAuth app, adopting the gh login on this computer, or a pasted token. It shares one token with the Factory, and agents get GitHub's hosted tools (api.githubcopilot.com/mcp, verified with an OAuth-app token: 46 tools, get_me answered). New wire: Plugin.local_login, Plugin.also_key, connect_browser code, plugins.connect_local, hello feature plugins_github. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…2649) * fix(app): add distinct custom connections and validate final saves * fix(app): gate provider instance semantics in hello * docs: number app provider connection change entry * test(app): prove region reopen and credential storage failure ordering * fix(app): identify custom model providers by connection id * fix: clear provider merge gates with portable and joined fixtures * test(tui): gate ordered answer work before counting update calls * fix(factory): invalidate stop look on writes without scanning idle floors * test(pool): join fixture usage writers before removing their homes
…eps its next-day test Ports the two parts of #2648 (landed on app/v3 only) that dev's #2597 did not already cover. dev fixed #2648's first part, who starts the journal sync, its own way (the writer's journalStop/journalDone loop), so this keeps that design and adds only: - drainUsage and flushUsage also wait, under the same ceiling, until the journal has synced every row it held when they began (usagePending's appended/durable counts, appendedSoFar, syncedThrough, awaitUsageJournals). A sync still waiting out its 100ms interval after a close used to lock, and so recreate, a ledger whose home had just been removed. - TestPendingPreviousDayDoesNotBlockNewDay uses UTC-12 then UTC+12 instead of the host offset plus a day, which on a UTC runner is +24:00 and cannot be marshalled. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Teams routes, storage, operator checks, membership, events and /v1/me teams for the Teams wave (G1). Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Every /v1/workstreams* route of the Teams wave contract: a durable store beside the go-ahead policies, visibility and write rules, rev + If-Match (412 when stale), soft delete with an operator-only purge, owner change, shares with include_linked and its preview, one-shot import of a Personal workstream, workstream.changed / workstream.removed events filtered to the people who could see the workstream, and go-ahead approval on an org workstream now needs write access to it. Team membership is read through serve.TeamMembership (TeamsOf, Members, optional HasTeam), which the teams lane fills; store.TeamOwnsWorkstream answers whether a team owns any workstream. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…anization (#2623) The Teams wave G3 engine methods, factory.me teams, and hello org_teams/org_workstreams. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…ht of the workstream (#2625) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…#2630) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Job write doors need the job person, edit on its workstream or the operator; sight needs repo read and view on its workstream; a profileless sign-in sees no workstream job. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…Yjs updates (E7) (#2636) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
… private (#2637) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…e, per-page revs, versions (E2) (#2639) Storage moves to factory-workstreams.db (migrated from the JSON once). Pages one at a time under their own rev, client-saved versions and restore, plan/wakes/suggestions, job membership (now deciding who reaches a job), unarchive, budget and spend, supersede-not-delete, part-level events and activity, and a factory.org_workstream_<part> engine method per route. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…ne person drives each (#2633) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…he organization's key (#2641) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…s-core (E4) (#2638) The server execs canvas-core's `canvas rpc` for every canvas read and write; routes /v1/canvases*, access through the E1 core, per-person frame hands with a 409 conflict, canvas.changed/removed events, Personal-canvas import, canvas presence, frame text as E7 documents, engine factory.org_canvas* and the org_canvases hello word; the demo server ships `canvas`. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…set (#2651) * factory: the server agent defaults to OpenRouter when no base URL is set On an organization server started without CODEAF_BASE_URL, every server agent turn failed with "provider base URL is required": the runner passed an empty base URL, meaning OpenRouter, and the provider client refuses an empty one. Unset now means OpenRouter's own address (config.DefaultBaseURL), the one provider an organization key is kept for; a set variable is still the operator's own proxy. The server profile's base_url is still not read. Found by the teams demo film rehearsal (defect D9). Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * changes: name #2651's fix Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> --------- Co-authored-by: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…d (E9) (#2646) * factory: an organization's people sign in with a username and password (E9) A team server takes a username and password by default, with GitHub as the second way in. An account is made through the operator link or an invitation, consuming the link in the same locked write that makes the account. Passwords are argon2id (OWASP 46 MiB, t=1, p=1) in PHC strings, NFKC-normalized, 12 characters to 256 bytes, checked against an embedded common-password list and the username. Sign-in is throttled per username and per resolved client address with decaying backoff; unknown, wrong and removed accounts get one sentence and the same hashing cost. Sessions reuse the server's access sessions: 30 days idle, 90 days absolute, ended by a password change, a reset or a sign-out. The operator can make a one-hour, single-use reset link for a password person. Password routes are JSON only, strictly decoded, 8 KiB, no-store, and refused over plain HTTP except on loopback or behind a trusted HTTPS proxy. Every account change is audited and no password reaches a log, record, file or answer. The engine serves factory.access_sign_up, access_reset, password_sign_in and password_change behind the hello word factory_password, holding every session the way access sign-in does. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * changes: name #2646 in its entry Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * changes: end each claim of #2646's entry in a full stop Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * engine: read the sign-in cache under a deferred unlock Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: close the security review's findings on password sign-in H1 A session carries the password generation it was made under; a change or a reset moves the generation, and mintSession re-reads it under the session lock, so no session made with an old password outlives the change. H2 A link made for one GitHub login takes no password and offers none. H3 A try spends its throttle tokens on entry and gets them back only for a right password; one sign-in of a username is verified at a time. M1 Backoff is keyed by (username, address); a looser per-username ceiling skips addresses the person signed in from before, so a stranger cannot keep the owner out. M2 A username already named anywhere on the server (a GitHub login that ever signed in, a share, a team, an owner, a driver, a job, the record) is taken. L1 IPv6 counts by /64; a backing-off key is never evicted, a full set refuses. L2 A transparent rehash compares and swaps on the hash it verified; a change compares on the generation. L3 The common list is NCSC 100k plus xato-net's top million and famous passphrases, compared by letters and digits: about 486,000 entries. L4 A GitHub sign-in checks the name again under joinMu before its session is stored, and remembers the handle for good. L5 accounts.json is cached by mtime and size; a read error refuses the request and keeps the session. L6 Typed passwords are passing secrets: at least 8 bytes, the latest 64 kept. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: trust a person's own machines against a stranger's guesses (second review) M1: every sign-up, reset, change and sign-in without one hands the machine a device token (256-bit, kept server-side as SHA-256 in accounts.json, bound to the person and the password generation, 180 days, 16 per person, revoked by a change, reset or removal, surviving a restart). A try with a valid token skips the username's ceiling and counts by the device and its address. The engine keeps the token beside the session through factory.sessions_take and factory.session_restore and presents it on later sign-ins. The in-memory trusted addresses are gone. A new machine during an attack uses the operator's reset link, which is never throttled. M-new: the changing session is valid at gen+1 before the write, so concurrent requests never sign it out. L-a: refunds are hand-counted credit. L-b: a full set logs once a minute. L-c: punctuation, keyboard runs and few-character passwords are common. L-d: a hash waits up to 500 ms for a slot. POST /v1/me/password answers 200 {device_token}. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: a password person is not said to have signed in with GitHub /v1/me and the password sign-in answer said github_signed_in true for a password person. It is now true only for a GitHub sign-in; sign_in_kind "password" says a password person signed in, and the engine's can_sign_out reads either. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: a device token only when the client can keep it, and none in use is pushed out (re-review #2) N1: a device token is made only on want_device; the engine asks only while the app's core says factory.sessions_store {can_keep: true} (unsaid is false). A device is marked used at every sign-in with it, and a person's sixteen live devices are never evicted: past that a sign-in succeeds with no new token, said once in the log. N2: a signed-in password change counts per session, not against the username's ceiling. N3: a trusted pair is keyed by device and address, so a stolen token used elsewhere backs off only itself. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: one session's or one device's guesses are capped across every address (re-check 3) F1: a password change counts in one bucket per session with no address in the key, so a stolen session spread over 30 addresses gets 10 current passwords checked, not 300. F2: a device token keeps its (device, address) pair bucket and also has a ceiling of 100 across every address; past it the try counts as untrusted, so a stolen token from 30 addresses gets 100 trusted checks plus the username's ceiling, not 300. F3: the concurrent-guess test asserts the real bound, the username's ceiling. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> --------- Co-authored-by: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
… Overview (#2657) * factory: an organization workstream made with no pages starts with an Overview createWorkstream kept whatever pages the request carried, so any client other than the desk made a workstream nobody could write in. The server now adds the desk's own Overview page (title "Overview", kind overview, empty) when the create carries no pages. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * changes: name #2657 in its entry Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> --------- Co-authored-by: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…#2658) The server agent's text on a page edited live is kept as the newest version without being applied, so a client that called the highest version current called a version the page does not hold current, and offered no Restore on it. GET .../versions now answers live_version (the newest version the page held: a snapshot of the live document or a restore) and marks the agent's unapplied versions kept until a restore names them. The agent's words now match what History shows. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…2652) * factory: an organization's people sign in with a passkey, in their own browser (E10) The server offers passkeys (WebAuthn, via github.com/go-webauthn/webauthn) first wherever its address is https with a DNS name. The ceremony runs on a page the server serves, in the person's browser; the engine starts a flow with a PKCE-shaped challenge and polls with its verifier for the session. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * engine: factory.passkey_start/poll/cancel/list/remove and hello factory_passkey (E10) The engine makes and keeps the PKCE verifier, opens nothing itself, checks the ceremony url is on the organization's own origin, and keeps the session a done poll answers exactly as access_sign_in keeps one. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * manual: passkeys on an organization, and a reset replaces every way in (E10) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: passkeys proven end to end in Chromium, WebKit and Firefox against the real binary (E10) scripts/passkey-e2e.sh runs a real codeaf factory serve over TLS at https://localhost, two real codeaf app engines, and Chromium with CDP virtual authenticators on the internal, hybrid and usb transports. The run found that the page's form rule beat the hidden attribute, so a browser with no WebAuthn still showed the button. domain: localhost is now accepted with tls: files. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: a passkey ceremony finishes only on the computer that started it, and taking over an account needs a fresh proof (E10 review) C1: every flow binds a one-shot listener on 127.0.0.1 in the engine; the page hands the browser there with a one-time code, and the poll answers a session only with the verifier and that code. A sign-in, join or add opened on another device never completes (state elsewhere). Joins and adds write the account only at that poll. H1: adding a passkey, a first password and removing a passkey need a proof from the last five minutes: a sign-in, purpose confirm, or factory.password_confirm. Otherwise step_up. An add by a person with passkeys asks for one of them first. M1: pending flows are capped per /64 and starts per /48, sign-ins get at most three quarters of the room, unopened sign-in pages end after two minutes. L1: a default port in the address works. L2: a wrong verifier is counted, not fatal; cancel needs https like the rest. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * manual: finish a passkey on the same computer, and confirm it's you (E10 review) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: the passkey e2e probes a sign-in opened on another device, and a confirmation (E10 review) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: a step-up is only ever its own flow, a flow belongs to one browser, and the loopback takes only its own code (E10 re-review 2) N1: an add no longer asks for an existing passkey along the way; it needs a confirm or the current password beforehand. The first page-origin options binds the flow to that browser (HttpOnly, Secure, SameSite=Strict cookie on /passkey/<flow>); options, finish and the hand-over refuse any other. The finish answer carries no code: the bound browser follows /passkey/<flow>/go once, a 303 to the engine's loopback. N2: a sign-in is never a step-up. N3: the code carries an HMAC under a key the engine sends with the start; the listener checks Host, path and that mark, answers anything else 404 (429 past 20 a second) and keeps waiting until its own code. N4: only a page-origin options opens a flow; opened sign-ins are capped per /24 or /48. The page says where it finishes before the browser's "can't connect". Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * manual: a sign-in is not a confirmation, a passkey page belongs to one browser, and the shared-computer limit (E10 re-review 2) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: the passkey e2e shows our words before the browser's error on another device, and confirms before adding (E10 re-review 2) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: one confirmation for one action, a __Host- browser cookie, fair eviction, codes live a minute (E10 re-review 3) A confirm is started for one action (add a passkey, remove passkey X, set a first password); its page names the action and the computer asking, and it lets that action happen once within five minutes. step_up names the action. The flow binds by a __Host-codeaf_pkb cookie no sibling host can plant; HSTS covers subdomains of a name the operator owns. A full table of opened sign-ins drops the oldest from the busiest network. A code works for 60 s after done, and the loopback answers it with a 303 to a clean /done. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * manual: confirm it's you for one change, once; shared wildcard hosts are for demos (E10 re-review 3) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: the passkey e2e checks the __Host- cookie, a clean /done, and one change per confirmation (E10 re-review 3) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: fair eviction never drains a busy network, few confirmations per session, a quoted computer name, opt-in includeSubDomains (E10 re-review 4) A full table of opened sign-ins takes room only from a network (/24, or /32 for IPv6) holding more than four and more than the newcomer's own plus one, oldest flow first; otherwise the newcomer is refused. A session holds three confirmations at most, a fourth replacing the oldest, and a full table drops the oldest anyone holds. A password confirm for a passkey the person lacks is a 404. The confirm page quotes the engine's computer name beside the session's sign-in date and the address the server saw. HSTS includeSubDomains is the operator's opt-in, hsts_include_subdomains. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * manual: the confirm page quotes the computer's name, three confirmations a session, hsts_include_subdomains (E10 re-review 4) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: an add or confirm with a stray field is a bad request; localhost is a one-machine trial address (E10, X1 browser leg) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * factory: a name cannot reorder or hide the server's words, three confirmations an account, a same-provider flood drains itself (E10 re-check 5) Display names, passkey names and the computer a confirm page names lose every format character (bidi overrides and isolates, zero-width marks); a control character, C1 included, refuses a display name, and the session's raw device label is cleaned the same way. The confirm page sets each such name in its own <bdi>. An account holds three confirmations across its sessions, oldest out. When the busiest network in a full table is an IPv6 /32, the sign-in it gives up comes from its busiest /48. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * manual: a flood from hundreds of networks can refuse new passkey sign-ins while it lasts; passwords are unaffected (E10 re-check 5) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> --------- Co-authored-by: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…out GitHub (film D10) (#2660) * factory: an organization's members make jobs on its repositories without GitHub (film D10) A person who signed in to an organization with a password or a passkey read no repository at all, because a signed-in person's repositories were only what their own GitHub token reached, so Add job had nothing to offer and Create job stayed off. The server's own GitHub grant fed only its poll. The repositories the operator turns on in Repos are now the organization's: every signed-in member reads them, beside whatever their own token reads, which is asked exactly as before. The operator also reads what the server's grant last discovered, so a password operator can choose from it in Repos. Only the operator turns one on or off, as before. A link's join check still judges a GitHub stranger by their own token alone. POST /v1/jobs (factory.job_create) takes workstream: the caller must be able to edit it, and the job joins it in the same request. A job on a repository the caller reads only through the organization must name one, so a view-only member reads jobs and makes none. The manual says how to make a job without a GitHub account and who turns repositories on. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * docs: the change entry for the organization's repositories (film D10) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> --------- Co-authored-by: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…ilm D11) (#2659) * factory: a canvas made in an organization workstream belongs to it (film D11) New canvas inside a team's workstream made the person's own canvas, so the team never saw it. A canvas can now belong to an organization workstream: POST /v1/canvases {workstream} (engine factory.org_canvas_create workstream, hello word org_workstream_canvases) makes it there, and it is reached the way the workstream is, its owner, shares and Private as they stand now, so a share added to the workstream later reaches its canvases too. Putting a canvas in a workstream needs edit on the workstream: a viewer is refused 403 and nothing is made. PATCH /v1/canvases/{id} {workstream} moves one in or ("") out. Canvas rows name their workstream. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * docs: name the D11 change entry after its pull request Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> --------- Co-authored-by: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…ions pointers) (#2661) * factory: a person joins an organization; Settings › Factory is Settings › Organizations The manual gains "join an organization", in the asker's words: joining one organization server brings its workstreams, canvases, chats and Factory at once, the three desktop doors that open it, and where Factory's settings moved. Person-facing pointers to Settings → Factory now say Settings → Organizations, and the CLI's refusal names an organization invite link. The codeaf://factory/join scheme and every wire name are unchanged. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * changes: 2661 join an organization Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * changes: 2661 names surfaces the check knows Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> --------- Co-authored-by: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
#2650) * engine: chats.read — read a chat on another computer without taking it A chat another computer holds can now be read page by page, newest first, from what that computer last sealed: only the transcript's own objects and the content-defined chunks under the page are fetched, into the store a later take of the chat uses, so continuing it afterwards pays only for the rest. No lease, no materialize, no agent, no workspace folder. - cellstore: want --path [--range], peek, read and a read-side import, run from the store root; ReadsPaths asks furrow --json capabilities. - cellsync: Reader (path-scoped want/gather/import, byte counting) and Pager (pages cut at person lines, opaque head+offset cursor, header line carried so a newer format still says so); FakeEngine chunks files. - syncsetup: Sync.ReadChat over the take's engine and per-chat scope. - appwire/app: chats.read behind feature chats.read, advertised only with a relay and a capable furrow; entries shaped by agents.entries' code. Measured on real furrow: first page of a 16.8 MB chat fetched 644 KB (3.8%), a new turn 294 KB, and a take afterwards refetched nothing. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * docs: change entry for chats.read (#2650) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * cellsync: the oldest page reaches byte 0 instead of leaving an empty page On two GCP machines a chat whose turns split into whole pages ended with one more page holding only the session header: more was true, and the viewer paid a round trip that answered nothing. The cut on the file's first chunk now reaches byte 0 when it lands on the first message. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * docs: what reading a chat on another computer cost on two real machines Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * furrowbin: embed furrow v0.3.7, which reads one file of a relayed snapshot v0.3.7 (Agent-Field/furrow#29, #31) adds want --path [--range], peek and read, the verbs chats.read needs; with v0.3.6 the feature stayed absent from hello. Checksums taken from the release assets and checked against its SHA256SUMS. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * engine: chats.crew — a crew made on another computer shows as one crew (#2653) * engine: chats.crew — a crew made on another computer shows as one crew Chat rows now carry crew, crew_name, crew_manager and crew_kind. A chat held elsewhere takes them from a sealed crew its holder writes into the chat's directory record with every saved turn (Codeaf-Chat-Crews), so they survive the holder going offline; this computer's own teams store wins for any chat it lists. A remote crew stays read-only: no crew verb acts on it, chats.send reaches its manager, agents.take still moves one member as a single chat. The record, not the vault team sync, carries it: the vault merges a crew into the viewer's store as an editable crew it could drive, and the app runs that round only while pairing is pending, which is why the GCP pair saw crews.list [] and three loose member rows. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * docs: change entry for chats.crew (#2653) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> --------- Co-authored-by: CodeAF <267109073+agentfield-bot@users.noreply.github.com> --------- Co-authored-by: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…st publish (#2654) * syncsetup: the background copier no longer displaces a chat's own first publish A chat started before its directory record existed is found by the next sharing pass, which uploads it beside the drive's own first publish, creates the record and releases it at once. With a large working folder the copier won, and the live drive read that free lease (or this computer's own hold) as a chat released from this window: every later send was refused with "This chat is available to continue here." and the pending turns were branched off the record the other computer reads, which is why a restart left the chat orphaned. A drive still at fence 0 has never held the record, so a reading that names no other computer is its first publish still on its way. ConfirmWork, CheckLease and HoldsLease now say so instead of displacing it; the first publish takes the record over through Publisher.resume. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> * changes: the copier keeps a new chat's first publish (#2654) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com> --------- Co-authored-by: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Correct the Overview manual after W1 screenshot review, alongside desk PR #615. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…ork (#2802) The chat manual follows the desk's Inbox (lane I1): Set up in the Inbox for an organization's admin with Not now, no Still to set up on Work, chats asking you under the six sections, no Answer together, and no Connect your GitHub promise. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…reens (T1) (#2803) An agent's task comment over 400 characters or 3 lines is kept as a document in Files, made by the task, and the thread gets one made line, which the desk draws with Open. The ws_task_comment description and the task-run prompt say so too. The manual now covers the build spec v2 Tasks screens: search and chips, the 420 list, the Add task row, ⋯ verbs only, Waiting on as a row, and no Uses or Add a step. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…2799) My space Afi reads all accessible workstreams while retaining its own write scope. Update the workstream manual and UI terminology. Local proof and the final trunk rebase are recorded on the PR. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…sk's line (#2806) A words-only answer to an Ask is kept in Decisions as \"Asked “<question>”, answered: <words>\", never as the Ask's own line, so the decision check no longer pauses work against the person's own answer. Manual documents Reply… on an agent's Ask. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…9) (#2808) Afi's card replies never go stale; manual for F2 (sim v3 D2, D5, D8, D9). Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
## Summary Answered Ask → question + answer → task receipt and Decisions Preserve decision provenance and display names through the organization bridge. Retain separate question and answer fields on task events. Keep publishing's retry remedy once. ## Evidence - Before: focused regressions reproduced lost fields and duplicated publishing instructions. - After: all three regressions pass. Build, vet, laws, changelog, both full touched package suites, packed manual and manual gates pass. Desk #639 includes 185 relevant tests and four browser combinations; 32 regression-view PNGs were inspected. ## Merge Danger **Door:** two-way **Blast Radius:** desk Additive wire fields; existing event text stays compatible. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
SIM D1: factory.org_workstreams takes archived (?archived=1), hello org_workstreams_archived; manual says where the archive is and when Archive asks. Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
…SIM F3) (#2811) Assisted-by: CodeAF Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Brings the org server (santosh/work) up to date with dev. Thirty-six files conflicted. Where santosh/work held an older state of a change dev has since landed (session, inbox dismiss, steer, factory manager press, override and finding rules), dev's version was taken. Where both sides added code (the chat wire types, the job wire fields, the activity record verbs, the job list handler, the manual probe table, the protocol page), both were kept. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A text merge of the two branches left declarations both sides had added, so the tree did not build. Each one is settled by renaming the smaller side and keeping both behaviours: - the job "extra task" request and refusal become JobTaskRequest and JobTaskRefused (same JSON fields and messages), since workstream tasks already own TaskAsk and TaskRefused; - the workstream decision-word normalizer becomes normalizedDecisionWords; - helpers defined twice with identical bodies are kept once; - pressAutoResume keeps the sendAutoResume wrapper, not the older body; - FeatureChatsRead names both chat-read abilities, which advertise the same hello word (the comment says so); - syncsetup's paged read at a head becomes ReadChatPage, leaving ReadChat to the scratch read of a saved chat. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A pure package that decides who may do what to an item, from an organization policy and the relationships on the item. It does no I/O. - Verbs are a closed enum (view, comment, edit, run, steer, answer, share, manage); the old role name "full" still means share and manage together, and "admin" is never a verb. - Roles are named, ordered bundles of verbs. Every role holds view, and the four names view, comment, edit and full cannot be removed or renamed. - Allowed answers from the union of the verbs of every role held; RoleOf names the highest-ranked one for display. - DefaultPolicy reproduces what the server did before policies existed. - An agent acts for its sponsor: its verbs are the sponsor's current verbs narrowed to the scope the policy gives it, worked out on every check. Granting to an agent as a subject is refused. - MayGrant lets a caller hand on only the verbs it holds, and lets an agent grant only if the policy says so. - Audience and Union say who hears a change, so an event can go to the people who could see an item before and the people who can now. OrgCanvas gains the two flags a policy default and an agent's canvas need. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… database Three tables join the SQLite file the org server already keeps: - grants: relationship tuples (subject, resource, role, who granted it and the sponsor of an agent, created, optional expiry). A lapsed row stays for the audit trail until removed. - resources: a registry for things with no document of their own, starting with chats (parent space, owner, creator, label, starting visibility). - org_policy: one row holding the policy and a revision. A write checks the revision it was read at, and refuses to drop a role a live grant or a default still uses. Owner, shares and the private flag stay on the workstream and canvas documents and are read as tuples, so nothing migrates. A workstream or canvas that goes private or is removed takes its grants with it, and a removed workstream takes the chats registered in it. The shared database handle may now hold a second connection, so a check made inside a workstream edit can read committed grants while the edit holds the write. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- api: the policy, resource, grant, preview and move shapes the access routes speak (policy and grant types alias the acl package). - record: org_policy_changed and resource_access_changed, with the verbs "org policy changed", "shared", "removed access" and "moved". - live: a policy edit can append its per-resource events and the org.policy_changed event as one batch kept inside the replay window. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e routes
serve/item_access.go stays the one decider (roleOf, can, audienceOf, hears),
now answering from the data-driven evaluator. Under the default policy it
answers exactly as it did, which a test pins by running a verbatim copy of the
old decider against the new one over generated viewers, items and verbs. A
per-request Access (the policy and a grant reader) rides on the Viewer, and a
test fails the build on any Viewer literal outside the two constructors.
Routes (a person who cannot view a resource always gets 404):
- GET /v1/org/policy for members, PUT for the operator, with a revision. A
change that alters who may see anything sends each affected resource's
event to the people who could see it before and the people who can now, and
org.policy_changed to every member (past 500 resources only that one).
- GET, POST, DELETE /v1/resources/{kind}/{id}/grants and POST .../grants/preview.
A grant may hand on only the verbs its giver holds, an agent's grant records
the agent and its sponsor, and a grant to an agent is refused.
- POST /v1/resources/{kind}/{id}/move for a canvas: it needs manage on the
canvas and edit on the destination, drops the canvas's own grants when the
destination is private, and tells everyone who gains or loses it.
- GET /v1/resources and POST /v1/resources for chats, which are registered at
creation (older ones privately at startup).
Server-run agents act as on-behalf-of principals: the sponsor's current verbs
narrowed to the agent's scope, never a copied grant. The policy sets whether
agents may create, share or grant, and the operator's defaults (sees private
items: no; may govern: yes).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
factory.org_policy, org_policy_set, org_grants, org_grant_add, org_grant_preview, org_grant_remove and org_move, each one request whose path is built from ids checked as one segment and whose body is the fields the route takes, so the app never chooses a path. An engine that serves them says "org_access" in hello. PROTOCOL.md names the methods and says how the server answers. No desk change: the server decides every question of who may do what. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Both sides kept in cmd/codeaf/fence.go (dev's OtherCodeafHomes beside santosh's desk canvas root), dev's wording for the GitHub sign-in paragraphs in the accounts page, santosh's sections of PROTOCOL.md kept, and the #2649 change entry carries both lines.
…thod Two lanes built the same ability: dev's agents.entries follows a saved remote head without taking the chat and advertises it under the chats.read hello word, and santosh/work added a chats.read method with its own chunk-paged reader on top of it. dev's implementation keeps the word and the behaviour. Removed: the chats.read method and its params and result types, the ChatsReader interface, the second half of the hello word, the cellsync and cellstore path reader that only it called, its tests, its change entry, and the furrow pin bump it needed (furrow is back on dev's pin). The remote-read design note says why and where the code can still be found in history. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ipts, expiry sweep
Phase 2 of the generic access model on the organization's server. Defaults are
identical to today: nothing changes until someone moves, shares or expires
something.
- Move a chat (owner only) between My space and a workstream they can edit.
The registry commits first and the folder follows, with startup finishing a
move the process stopped in the middle of; a chat that is answering is
refused; the answer names whether the chat's agent is usable at the
destination; one resource.changed goes to the union of the old and new
audience.
- Afi's pane and a task's working conversation are registered as sessions so a
grant can name them (backfilled at start, registered on first use, removed
with their task or workstream). Their existing routes behave as before.
- A read-only transcript of a shared chat or session through the one decider:
GET /v1/resources/{kind}/{id}/transcript and factory.org_transcript. An
allowlisted shape, no talk door, no side effects, and a refusal that cannot
tell absent from not yours.
- Grants that run out are announced to the people who lost access, once, by a
sweeper that only notifies (the decider already refuses an expired grant on
every read). The watermark survives restarts and never moves backward.
- PROTOCOL.md carries the new rows and events.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… organization A new page, organization-sharing, says what a grant is, what the roles and verbs hold, who sets the rules, that a shared chat is read only, that a move is not a share, what an expiry does and who hears of it, and that Afi's pane and a task's conversation can be named by a grant. It states that the desktop has no sharing buttons for chats yet. my-space no longer says a chat never moves; the workstream chats page points to the new one. Two older sections (the debug record, clicking a file path) say the asker's own words once more, because the new pages shifted the ranking of two probes that were already a hair from the line; the probes are unchanged. Eleven probes for the new page are added. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The factory registers as an AgentField node and names itself the owner of the runs it starts with X-AgentField-Run-Owner. A control plane with the generic app link can also check X-AgentField-Run-Owner-Proof, a scoped expiring token the node mints over its own live link with a delegate frame. The link now asks for that proof once it is up (own, read and act scopes) and the client sends it on the calls the contract names: the run's start, its transcript read and ack, a steer and an approval answer. A control plane that predates the proof drops the frame without an answer and one without relay storage answers 501; either way the link is marked as giving none after one short wait and every call goes out exactly as before. A proof is reused until five minutes before it lapses, forgotten on a 403 and replaced once, and never sent for another node's name or logged. A control plane that requires the proof refuses a missing, stale or wrong one with a 403 whose sentence starts run_owner_proof_. The client used to word every 401 and 403 as "did not accept that API key", so a refused proof read as a bad key. It is now its own refusal, told in plain words that say what happens next (a lapsed or refused proof is replaced on the next try; a missing one needs the link up), and only a refused proof is retried once with a fresh one. A 403 that is not a proof refusal and every 401 still read as a bad key. The manual says so in a new section of the AgentField page. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
internal/factory/lease/task_test.go asked errors.As for factory.TaskRefused, which santosh/work renamed to factory.JobTaskRefused when it gave the name TaskRefused to workstream tasks. The assertion is about a job's task refusal, so it now names the job's type; before this, it matched nothing and read as a failed refusal. internal/config registers three environment variables the branch added and the settings registry gate (TestRegistryCoversEveryUserFacingEnvironmentPin) refuses until they are plumbing or rows: CODEAF_SMTP_URL and CODEAF_SMTP_FROM (how an organization's server mails invitations) and CODEAF_FACTORY_NODE_ID (the id a computer's factory registers under on AgentField). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
TestAppCloseC3RealSessionContinuesOnceOnThePress asserts that pressing Continue carries the interrupted turn on exactly once, and counted every request that reached the model. After the first reply the app also asks the model to name the conversation, on its own goroutine, so one run in five saw two requests and failed (CI failed it twice on the pull request). The assertion is about turns, so it now skips the naming request, the way the other tests that count model requests already do. Eighty runs at one and four CPUs pass. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… run
This branch changes go.mod, so the touched set is the whole tree and the
rest leg ran packages nobody had touched in a while. None of these three
involves the organization work; each fails the same way on origin/dev.
- internal/atlas: the sync node named pullVault, which dev renamed to
pullVaultVia in the client-sync change. Name the symbol the file spells.
- internal/taskplace: the delayed result store closed its entered channel on
every GetMany, and the fetcher asks again after ErrUnreachable, so the
second call panicked the whole package ("close of closed channel"). Close
it once.
- internal/service: TestARepairIsRefusedBeforeAnythingHappens read the
signals Stop had sent before Stop's own goroutine had sent them. Under
load it failed, and the cleanup then waited forever on a stop grace that
only the test's clock could end, so the package hit its 15 minute ceiling.
Wait for the grace barrier first, the way the replacement tests already do.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A task's run counted itself out of the desk's wait group before it closed its Working conversation and published that, and before it started the next queued run. So Close could return, and a caller could remove the folder, while those writes were still to come. On a slow runner a test's TempDir failed with "directory not empty" about one run in three (the leftover was live-events.json); santosh/work's own CI shows the same failure on TestARunningTaskSaysWhatItIsDoingNowAndAQueuedOneItsPlace before any of this branch's work. The five tests that hit it all start task runs. Count the run out last, as the Afi run beside it already does. The test holds the events' lock so the last write cannot finish, and asserts Close is still waiting; it fails three times in three without the change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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 lands
One pull request that carries the organization server end to end, on top of current
dev:codeaf factory servein team mode): the work of thesantosh/workbranch. Workstreams, canvases, pages and files, tasks and standing orders, Afi per person, My space, teams and invites, password and passkey sign-in, the library, org agents and the server-side agent runner. About 185 commits and 135 change entries; the entries carry the detail.412on a stale edit).sessionresources, so a grant can name them;GET /v1/resources/{kind}/{id}/transcript, wirefactory.org_transcript);X-AgentField-Run-Owner-Proof, minted over its own live link, on the calls AgentField's owner-proof contract names, and stays compatible with a control plane that predates it. A refused proof is now worded in plain language and is no longer reported as a bad API key.chats.readclash, resolved:dev's implementation keeps thechats.readhello word and behaviour; the duplicate method and chunk-paged reader from the branch are removed (they stay in history, and the design note says so).Defaults are identical to today. Nothing changes until someone moves, shares or expires something; the org default policy behaves as the server always did.
Validation contract
Behaviours, in terms of what a caller observes:
stop it or wait for it to finish, then move it); the old place no longer lists it, the new one does, every line is kept; one event reaches everyone who could see it before or after. A crash between the registry commit and the rename is finished at the next start.viewon a chat or session reads its transcript and can never post to it. Anyone else, the operator included, gets the samenot foundas for a chat that does not exist. Reading does not touch the chat, start its agent or write the record. A removed or expired grant, or a move out of reach, is refused on the next read.Dispatch,Relay,RelayAck,Steerand approval answers, and on no other call. A control plane that never answers the proof request, answers 501, or answers without a token gets every call exactly as before. A refused proof is replaced once; a refusal that names the proof is never told as a bad API key, and a real bad key still is.The tests are named for the item they check (
TestContractI*,J*,K*,L*,M*ininternal/factory/serve,internal/factory/liveandinternal/appwire;TestContractN1..N9ininternal/factory/agentfield).Evidence
make test-quickgreen;GOOS=windowsandGOOS=darwinbuilds and vets of the touched packages green.make pr-readywas started and stopped after 60 minutes. This branch changesgo.mod(dependency bumps that came withsantosh/work), so the touched set is the whole tree, and a run under a shared laptop's limits cannot finish: everycmd/codeafshard reached its 15 minute ceiling. The failures it reported were then triaged one at a time (each rerun alone on the branch and compared withdev):TestARefusedTaskLeavesTheJobAndTheHold(it asked forfactory.TaskRefused, which the branch renamed tofactory.JobTaskRefused), andTestRegistryCoversEveryUserFacingEnvironmentPin(three variables the branch added were not registered:CODEAF_SMTP_URL,CODEAF_SMTP_FROM,CODEAF_FACTORY_NODE_ID);devin this sandbox:TestEveryFilePathExistsininternal/atlas(pullVault),TestTheClientRefusesAWrongKeyInWords(it dials a closed local port and ends with "did not answer in time"),TestGuardOwedAbsoluteMeasuredCommand(its fakegoon the path does not clear the saved failure);cmd/codeaftests named in the run (18 of them),TestFactorySetupContinueEndsReadingWithoutWatchingUnreadRepos,TestACompactionEncodesASnapshotNoSightingCanReachandTestAScriptedSessionCompilesItsChatsInBatchesAndNothingAfterIdle;CI's
touched packageslegs carry the full run.touched tui3,touched session,touched codeafand the Windows native tests passed.touched restfailed on three tests that fail the same way ondevand that no part of this change touches, each reproduced alone on the branch and ondev:internal/taskplace(a test double closed a channel twice and panicked the package),internal/atlas(the sync node still namedpullVault, whichdevrenamed topullVaultVia) andinternal/service(TestARepairIsRefusedBeforeAnythingHappensread a signal before the goroutine that sends it had run, then hung to the 15 minute ceiling). One test-only commit fixes the three. A fourth failure was real: five of santosh/work's task tests (TestARunningTaskSaysWhatItIsDoingNowAndAQueuedOneItsPlaceand four like it) failed on a slow runner withTempDir RemoveAll cleanup: directory not empty, and that branch's own CI shows the same failure before this work. A task's run counted itself out of the desk's wait group before it closed its Working conversation and published it, soClosereturned with a write still to come; it now counts out last, as the Afi run beside it does, with a test that holds the events lock and assertsClosestill waits (it fails without the change).internal/factory/servepackage passes (about 390 seconds under the box's limits), including every pre-existing access test unchanged except one constructor allowlist line.codeaf factory servein team mode starts and prints the address and the operator link; the operator claims with a password;GET /v1/org/policyanswers 200 with the four default roles; an invite link is made and a second person joins with it; that member reads the policy (200) and cannot change it (403); a transcript that does not exist answers the same 404 to the operator and the member; the server stops cleanly.internal/manualgates are green with a new page,organization-sharing, and eleven probes for it; four more probes cover the proof refusals.internal/session/prompts/system.mdpromises nothing that this adds.Decisions and limits
chats.read:dev's hello word and behaviour stay; the branch's separatechats.readmethod and its chunk-paged reader are removed. A desktop that was calling the removed method moves toagents.entrieson a remote row. Chunk-level paging of a remote transcript is not ported.fullcannot move someone else's chat.steerorrundoes not give a talk door yet.factory.org_*methods. The manual says so.🤖 Generated with Claude Code