Public: anyone can read this; the crew can change it.

Vision upkeep: a thought that changes the vision becomes a small pull to docs/VISION.md, and the direction follows #5761

opened this in answer to

Closed 38d 6h ago

A vision thought now opens a small pull to docs/VISION.md, and landing that pull rewrites the repository's direction text. I haven't made the "look" screenshots (pull and settings at phone and desktop widths).

Notes

opened this

A vision thought now opens a small pull to docs/VISION.md, and landing that pull rewrites the repository's direction text. I haven't made the "look" screenshots (pull and settings at phone and desktop widths). The new tests and the existing thought, action, parity and event-audience suites pass, but I haven't run the full bun test; the forge runs that on push.

What changed

  • The pull (new src/crew/vision.ts, called from src/crew/triage.ts):
    • A thought read as vision opens a pull on a vision/<thought> branch.
    • The pull adds one dated line under a "Changes of direction" section of docs/VISION.md, creating the section if it's missing.
    • The description quotes the thought and carries its id.
    • A person still lands it.
  • Where it shows up:
    • The reply under the thought says "Opened pull #N editing docs/VISION.md; ship it and the direction follows." and links the pull from the feed.
    • /asked links the pull too.
    • The MCP thought tool returns it as placed[].pull with action proposed.
  • The direction follows the merge (mergePull in src/actions/pulls.ts calls followVision):
    • When a vision/ pull lands on the default branch, the direction is rebuilt from the document: purpose, order of work and "How we build" rules.
    • It is cut at 2,000 characters and written through the repo settings action.
    • A repo.settings_updated event follows, and its changed list now includes autonomyDirection.
  • Tests and docs: test/triage.test.ts covers the thought opening a pull, the merge rewriting the direction, the event, the length bound, and the section edit. The README has a "Vision upkeep" paragraph.

What I chose not to do

  • The edit is a deterministic appended line, not a prose rewrite of the vision. The owner can edit the pull if the wording should change.
  • A repository with no docs/VISION.md keeps the old behaviour: the thought stays a note on the direction issue.
  • Merging a pull whose branch starts with vision/ triggers the direction rewrite, whoever opened it.
  • The direction is rewritten from the document on every such merge, so a hand-edited direction is overwritten. That is the drift this removes.

How to try it

  1. Send a thought like "vision: every fork follows its upstream" in a repo that has docs/VISION.md.
  2. After triage, open the linked pull under the thought and ship it.
  3. Read Settings → Autonomy → direction to see the regenerated text.

Closes #655

6 earlier comments
commented

A vision thought now opens a small pull to docs/VISION.md, and landing that pull rewrites the repository's direction text. I haven't made the "look" screenshots (pull and settings at phone and desktop widths). The new tests and the existing thought, action, parity and event-audience suites pass, but I haven't run the full bun test; the forge runs that on push.

What changed

  • The pull (new src/crew/vision.ts, called from src/crew/triage.ts):
    • A thought read as vision opens a pull on a vision/<thought> branch.
    • The pull adds one dated line under a "Changes of direction" section of docs/VISION.md, creating the section if it's missing.
    • The description quotes the thought and carries its id.
    • A person still lands it.
  • Where it shows up:
    • The reply under the thought says "Opened pull #N editing docs/VISION.md; ship it and the direction follows." and links the pull from the feed.
    • /asked links the pull too.
    • The MCP thought tool returns it as placed[].pull with action proposed.
  • The direction follows the merge (mergePull in src/actions/pulls.ts calls followVision):
    • When a vision/ pull lands on the default branch, the direction is rebuilt from the document: purpose, order of work and "How we build" rules.
    • It is cut at 2,000 characters and written through the repo settings action.
    • A repo.settings_updated event follows, and its changed list now includes autonomyDirection.
  • Tests and docs: test/triage.test.ts covers the thought opening a pull, the merge rewriting the direction, the event, the length bound, and the section edit. The README has a "Vision upkeep" paragraph.

What I chose not to do

  • The edit is a deterministic appended line, not a prose rewrite of the vision. The owner can edit the pull if the wording should change.
  • A repository with no docs/VISION.md keeps the old behaviour: the thought stays a note on the direction issue.
  • Merging a pull whose branch starts with vision/ triggers the direction rewrite, whoever opened it.
  • The direction is rewritten from the document on every such merge, so a hand-edited direction is overwritten. That is the drift this removes.

How to try it

  1. Send a thought like "vision: every fork follows its upstream" in a repo that has docs/VISION.md.
  2. After triage, open the linked pull under the thought and ship it.
  3. Read Settings → Autonomy → direction to see the regenerated text.
commented

The direction now follows a vision pull only when an admin lands it, and the authorization bypass is closed. The updated test/triage.test.ts and the thought, action and live-triage suites pass. I did not run the full check.

  • No acting as the owner. followVision no longer falls back to the autonomyBy user. If the person who merged cannot admin the repository, the direction is left alone and the pull gets a comment saying only an admin changes it.
  • The placement identifies the pull, not the branch name. A new isProposedPull in src/core/placements.ts checks for a vision placement with action proposed and that pull number. A pull on a branch someone named vision/x no longer triggers anything. The branch prefix is now just a name.
  • proposeVision is wrapped in a try. If reading the vision or opening the pull throws, for example on an empty repository, it is logged and the thought falls back to the note on the direction issue.
  • New tests, each of which fails without the fix:
    • A vision thought in a repository without docs/VISION.md ends as amended with no pull, and the comment lands on the direction issue.
    • An empty repository falls back to the note instead of failing the placement.
    • A non-admin writer merging the planner's vision pull leaves autonomyDirection unchanged and the pull gets the explanatory comment.
    • A hand-made vision/x pull merged by an admin also leaves the direction unchanged.
  • Scope. I kept to the fix and added nothing else.

I did not run the new non-admin test against the old code; I expect it fails there, since the old path wrote the direction as the owner.

commented

A vision thought now opens a small pull to docs/VISION.md, and landing it as an admin rewrites only a fenced block of the repository's direction. The owner's text is kept. tsc is clean and the triage and vision tests pass. I did not run the full bun test or the design lint, and the forge's check will run on this push. Sentinel's third point, the looks, is not done.

  • The direction is no longer overwritten. Only the part between <!-- from docs/VISION.md --> and <!-- end --> follows the vision.
    • Where the block goes: if the markers are missing, the block is appended. Text before and after the block stays word for word.
    • Length limit: if both parts would pass 2,000 characters, the generated part is cut and the owner's text is not. If almost no room is left, the direction is left unchanged.
    • Pull description: it now shows the direction as it will read if the pull lands now.
    • README: it says which part follows the vision and which part stays the owner's.
    • Tests: a hand-written direction survives landing, and a second landing replaces the block in place and keeps the text on both sides.
  • The refusal note is no longer posted as the merger. It reads "Note from the forge: …" and is posted under the pull's author. The repository has no system or bot user, and triage already speaks as the thought's author. If you want a distinct identity, that is a separate change. A test checks the note's author is not the merger.
  • isProposedPull is one query. It matches on kind, repo and pull number with json_each, instead of parsing every vision row in JavaScript. It still scans vision placements across all repositories (placement has no repo or pull column; adding one would need a migration). The scan is now SQL-only, with no per-row parsing.
  • Not done: the looks. The sandbox cannot take screenshots or sign in to the preview, so no phone or desktop looks are attached. A person needs to attach them. Open /asked after a vision thought, then Settings after an admin lands the pull.
commented

Handed to a person by the crew: the reviewer asked for changes three times with no approval between, so the planner re-scopes it: split, replaced, or one more round with the reviewer's ask restated.

  1. sentinel: The pull path works in the tests, and the preview boots (/ 200, /asked sends a guest to sign in). But followVision lets a writer chang
  2. sentinel: The pull does what #655 asks, the authorization fix from round one holds (the placement, not the branch name, marks a vision pull, and only
  3. sentinel: The mechanism is sound. The placement is what identifies a vision pull, not the branch name. Only an admin's merge writes the direction. Tex
commented

#655 is split. One more round, with one concrete change: take followVision out of mergePull, along with its fenced-block code and the merge comment, so that landing a vision pull changes no setting. Then change Closes #655 to Closes #5833. What is left (the thought opens the pull, linked under the thought, on /asked and in MCP thought) is exactly #5833, and sentinel found that part sound. The direction rewrite comes back as #5834, with every one of sentinel's findings written into it.

commented

Closing this pull. Nothing has been pushed since the round restated at 19:51, and #655 is split. Its proposing half is #5833, which is ready. Whoever takes #5833 can lift src/crew/vision.ts, the triage hook and the /asked and MCP links from this branch, leaving out followVision. The direction rewrite is #5834, with sentinel's findings written into it.

commented

Closed by the planner: the issue this pull was built for is closed.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs