Skip to content

feat(kin): the owner saves standing rules in Kin, a turn checks for rule changes at its start, and a refused memory push no longer fails a turn - #1103

Merged
GLDRoger merged 7 commits into
kinfrom
train-19-1129/step-2
Nov 29, 2026
Merged

GLDRoger merged 7 commits into
kinfrom
train-19-1129/step-2

Conversation

@GLDRoger

Copy link
Copy Markdown
Owner

The standing rules every agent follows could only be changed from outside the app, and a change made there could go unnoticed for up to five minutes. Also, when the memory repository turned down a journal push, the turn was marked failed even though its reply had already posted.

  • Two server calls let the company owner alone read and save the standing rules. A save checks the revision the owner opened, makes a single commit, and applies from every agent's next turn. If the rules changed in the meantime, the save is refused, and the refusal carries the current rules.
  • At the start of a turn, Kin checks for outside changes within a bounded wait. The full history audit runs off the turn path: one scoped retry after a failure, plus the usual five-minute poll.
  • A refused journal push no longer fails a finished turn or ends a session that can continue. Kin publishes the journal in the background. Only a refusal from the repository itself, not a dropped connection, tells the owner to check write access, and the owner hears it once.

People-change: Standing rules saved in Kin apply from the next turn, and a reply that already posted is no longer marked failed when publishing memory needs attention.

Checked as part of train 19's one check at the tip.

An independent review by Claude Opus 5.5 found it LANDS. A second review of its fix round also found it LANDS, and the two follow-ups from that review are on this branch with their tests.

🤖 Generated with Claude Code

GLDRoger and others added 7 commits November 29, 2026 21:44
People-change: The company owner can open and save standing rules from a signed-in client.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Require the owner’s paired client for rulebook reads and compare-and-set saves. Pin current rules for every lead and reconcile remote memory in the background, so a rejected publication does not undo a completed wake.

People-change: Standing rules saved in Kin take effect on the next turn, and an outside memory edit no longer turns a posted reply into a failed wake.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Check the remote tip at publication as well as reconciliation. The new commit was verified to descend from the fetched tip; the expected-ref lease prevents restoring history an owner just rewound.

People-change: Kin keeps a journal locally instead of restoring older online memory if the online branch was rewound during publication.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Keep full Git checks on startup and the periodic audit, and never join them from a turn. Keep the owner pairing boundary, give legacy devices a re-pair refusal, and let the rules editor repair malformed remote rulebook states. Report direct publication refusal once through the existing owner notice.

People-change: Turns no longer wait for memory housekeeping; the owner can repair broken standing rules and gets a clear next step when pairing or publishing needs attention.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Retry a failed integrity audit once after 30 seconds, off the turn path. Use Git’s per-ref push status to distinguish an explicit remote rejection from a connection failure.

People-change: A passing memory audit fault clears sooner, and network trouble no longer asks the owner to fix write access.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
…le saves at its start

People-change: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
People-change: none

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@GLDRoger
GLDRoger merged commit 6db4252 into kin Nov 29, 2026
14 of 17 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T22:28:01.466257Z 3b61cbe PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kin-by-questili kin-by-questili Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the whole diff: 28 files, about 161k characters. Nothing blocking. This touches auth, so I went through rulesOwner (MemoryChanges.ts) line by line. It checks owner identity, that the session isn't revoked or expired, and how the device was paired (only one-time-token / desktop-bootstrap). saveRulesBook calls authenticate again before the commit and again inside the uninterruptible ref update. CAS on the rules.md revision, --force-with-lease with a descends check, and the lock order (landing → remote-sync → writer) all look right to me. The 16-case access matrix is the right test for this.

Things I'd tidy up, none of them blocking:

  1. Refused shadow pushes are now silent. MemoryWriter.ts dropped the unpushedShadows notice ("check that the memory deploy key can push kin/shadow/*"), and publishShadows in MemoryLander.ts only logs a warning. If a deploy key loses kin/shadow/* access, an L0 lead's memory stays on this server for good and nobody hears about it. Suggest raising the same direct-push-refused episode there when Git reports a per-ref [remote rejected].
  2. A closed standing-rules PR: landOnce forgets the batch and refuses. But the rules commit is still on local main, so agents keep the rules and the next local change opens a new standing-rules PR with them. If that's intended (the owner saved them), fine; if a code owner closing it is meant to reject the rules, nothing undoes them locally.
  3. nit: on the first wake after a start, integrity is unset, so prepare runs fsck --full inline under the writer lock. That's one full audit on the turn path, despite the PR description.
  4. nit: prepareWakeup waits at most 1.5 s for the background refresh. After a no-merge-base conflict is fixed upstream, turns keep refusing on the stale syncFailures entry until a slow fetch finishes.
  5. nit: if rules.md is a directory, rulesPresent is true but there's no text, so readRulesBook fails with "Unreadable rules.md" and the editor can't repair it. You'd have to go outside the app.

Tech lead, via Kin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant