Commit Graph
68 Commits
Author SHA1 Message Date
imccyu 16072178a9 fix(forge-panel): follow the panel after the Session opens and name cold Sessions by id
The panel follow resolved its Session argument by resuming the Agent while the
main view was still opening the same Session, so the Host read the Session log
twice. The follow stream now holds a forgePanel Session reference and waits for
the Session's history to open before following. refresh, reviewStage, and
worktreeCleanup only need the identity, so they take a SessionId and no longer
resume an Agent; worktrees.cleanupOf takes the id as well.
2026-11-18 23:06:35 +08:00
LegGasai 1a4c16a9bd Merge branch 'feat/client-review-page-seams' into worktree/forge-m7-review-page-ee17bf
Brings in master and the required onWorkspaceSelected callback of conversation.content.

Adaptations:
- The review chat handles a picked Workspace itself: it connects the Workspace's blank, keeps only the latest pick of
  the conversation still shown, moves the draft while both Sessions are retained, and reports a failed connection.
- The compact list title uses the shared MarqueeText instead of the title marquee this stack carried.
- Master moved the change request cards into the Session panel: the review detail reuses the card's merge action and
  rows and draws its own ready-for-review action, and keeps its own Refresh status label.
2026-11-17 20:52:43 +08:00
LegGasai 0c8078e196 feat(forge): name worktree branches, start them from remote branches, and show changes being read (#8536)
* feat(forge): name worktree branches, start them from remote branches, and show changes being read

The New Session worktree option's base menu now searches local branches and
each remote's branches, pins the current branch and every remote's default
branch, and names each remote group by its repository. Its last row opens a
dialog that names the new branch, starting from `worktreePrefix` and checking
Git's branch-name rules; the Host refuses an invalid or taken name. A request
records the full ref of its base and the optional name; every attempt uses the
name.

A remote-tracking base is fetched first: the worktree service gains a
`fetch` request field and a `fetch` phase, fetching only that branch without
tags. A failed fetch leaves the message waiting with Retry, Use the last
fetched version, and Continue without a worktree; a taken name offers Rename.

While the changes view reads changes it has not shown yet, it says
"Reading changes" above file card placeholders, and the files menu names no
count.

* fix(worktree): forward only the declared create_worktree arguments

The create_worktree parameter object is open, and the tool passed it to the
worktree runtime unchanged. Now that a runtime request can ask to fetch, an
undeclared `fetch: true` from the model would have fetched, or refused a local
`from`. The tool now forwards only `name` and `from`, so it never fetches.

* docs(forge): say that only generated worktree branch names come from the Session id

* fix(forge): keep the collapsed change request status on one line

In the Session panel the collapsed card's number line kept every part at
full width inside a clipping row, so a narrow panel cut the most urgent
flag off without an ellipsis, such as "有冲突" after "3 项检查失败".

The number and status now form one MarqueeText line as wide as the row.
While the line with failed checks does not fit, they take the shorter
wording without their count; a line that still does not fit ends in an
ellipsis and crawls into view with the title while the pointer rests on
the card's head. The line measures again when its width or the fonts
change. Expanded cards keep their branch names as before.

* fix(forge): hide remote credentials and read the branch a tag shares its name with

The base menu named an unrecognized remote's group by its fetch URL as
`git remote -v` prints it, so a token in the URL, such as
`https://oauth2:[email protected]/...`, reached the browser and showed
in the menu. The group now shows the URL without its user name and password.

Inspection read the checked-out branch with `symbolic-ref --short HEAD`,
which prints `heads/main` while a tag is also named `main`; the New Session
option then requested `refs/heads/heads/main` and every worktree attempt
failed. Inspection now reads the full ref and takes the name under
`refs/heads/`, so the option, the pinned current branch, and the checkout
row name `main`. HEAD that names a ref outside `refs/heads/` reads as no
branch.

* test(worktree): set up nested remotes and line endings the CI runners' Git accepts

Git 2.55 on the CI runners refuses `git remote add team` next to an
existing `team/fork` remote; the check runs only in `git remote add`, so
the longest-remote case now writes the second remote with `git config`, as
configuration written earlier or by hand holds it. The test clone also
turns off `core.autocrlf`, as `repository` does, because the Windows
runner's global setting checked the fetched file out with CRLF.
2026-11-16 16:13:00 +00:00
LegGasai bd99b1e062 Merge branch 'feat/session-panel' into feat/session-panel-sections
Brings master (through feat/session-panel) into this branch. Master changed
controls this branch had moved into the Session panel, so its changes are
carried over to their new homes:

- Jobs: master hides the stop control without `job/kill` access in the
  header list this branch removed; the panel's Background jobs section now
  reads `useAccess('job/kill')` the same way.
- Forge: master takes the sign-in command from the provider
  (`readiness.signIn`) in the sidebar tab this branch removed; the panel's
  sign-in row now does, for any code host, instead of building a GitHub
  command itself.
- Agent team: the team settings pane and its copy from master, with this
  branch's Shared tasks section registration.
- Tests: master's helpers for the team settings pane and its numbered
  reference helper are combined with this branch's panel steps; the
  status fixture gains master's `completionFailed`.
- READMEs of ui-agent-team and client-ui-forge are merged sentence by
  sentence; generated catalogs, the persistence schema, and pairing
  records are regenerated.

The upgrade guide moves to docs/upgrade-guide/v0.2.2-rc.3, the root
version after master's release.
2026-11-15 13:00:24 +08:00
LegGasai d7841ef3fc Merge branch 'feat/client-review-page-seams' into worktree/forge-m7-review-page-ee17bf
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/subsystems/forge.md
#	docs/subsystems/forge.zh.md
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/src/client/ChangesTab.tsx
#	packages/experimental/client-ui-forge/src/types.ts
#	packages/experimental/forge-github/README.i18n.yaml
#	packages/experimental/forge-github/src/provider.ts
#	packages/experimental/forge-github/tests/plugin.spec.ts
#	packages/experimental/forge/README.i18n.yaml
#	packages/experimental/forge/src/index.ts
#	packages/experimental/forge/src/types.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
2026-11-13 16:28:28 +08:00
LegGasai cb44a3c2ee feat(forge): read, review, and bind GitLab merge requests (#8317)
* feat(forge): let providers declare their hosts, names, sign-in, and review decisions

Prepare the forge contract for a second provider:

- ForgeProvider lists the hosts it serves and names itself (label,
  changeRequestNoun); registering a provider that lists a host another
  registered provider lists throws, so each URL has at most one provider.
  ctx.forge.describe(forge) returns the family's ForgeDescription.
- ForgeReadiness carries the sign-in command, which the panel's sign-in
  banner shows instead of building `gh auth login` for the github family.
- ForgeReviewData lists the review decisions the host lets the reader
  record; the review dialog offers only those instead of hardcoding the
  GitHub rule that a pull request's author may only comment.
- ForgeReviewThread.original may name a later commit the host carried the
  thread to while its lines stayed unchanged.
- The changes view names the code host and its word for a change request
  from the entry's ForgeDescription instead of hardcoding GitHub and PR.

The GitHub provider declares its configured hosts, GitHub, pull requests,
`gh auth login --hostname <host>`, and reads viewerDidAuthor for the
review decisions. Upgrade guide: forge-provider-hosts.

* feat(forge-gitlab): read GitLab merge requests through the GitLab CLI

Add the experimental forge-gitlab provider. It serves the configured
GitLab hosts through glab: status batches over GraphQL, head-pinned
patches from merge request diff versions, commit listings, merge bases,
pipeline jobs, closing issues, and review threads mapped from REST
discussions, including outdated threads' hunks.

The forge bundle composes the provider, disabled by default.

* feat(forge-gitlab): write GitLab reviews, retry pipelines, request reviews, and rebase

The GitLab provider now writes through glab as well as reading:
comments start discussions at positions derived from the head's diff
version, pending replies and comments are draft notes that a review
publishes with its summary and review state, and approving checks the
head through GitLab's sha parameter. Review reads carry the signed-in
user's rights from GraphQL, their draft notes as the pending review,
and the decisions GitLab lets them record.

Snapshots name the head pipeline as every job's rerun, offer rebase as
the branch update, and follow GitLab's permissions for reruns and
review requests. updateBranch's contract now states how a provider
whose host takes no expected head checks it.

* feat(forge): let forge providers register the commands that bind change requests

forge-session no longer recognizes gh commands by itself. A provider now
registers a declarative ForgeCommandRule through
ctx.forgeSession.registerCommands: its executable, creation and reference
subcommands, change request page path, JSON URL members, declared
options, and a pure select that maps one parsed reference command to a
URL or a read-only lookup. forge-github registers gh and forge-gitlab
registers glab, which adds glab mr create, view, update, and checkout,
including numbers with -R: a full project URL binds directly, and other
repository forms resolve through glab mr view in the call's shell.

forge-session keeps the shared parts: the literal shell tokenizer,
option parsing, output reading, lookups, and the projection. The
forgeChangeRequests state version derives from the recognized rules, so
a changed rule set refolds every Session, including commands that ran
before the provider loaded. Ending a registration keeps its rule
recognized until restart, so unloading providers at shutdown does not
rewrite every checkpoint.

* refactor(forge-gitlab): publish the GitLab provider as @deepseek-ai/dsh-forge-gitlab

New experimental packages omit the experimental prefix so that promotion
keeps their npm name. Register the directory in
EXPERIMENTAL_PACKAGE_NAME_EXCEPTIONS instead of growing the legacy
prefixed list, and rename every dependency, configuration row, path
mapping, and document that names the package.

* fix(forge-gitlab): keep review writes, comment positions, and reads within GitLab's facts and the limits

- After GitLab refuses a publication, read the drafts again: delete
  them only when all remain, since GitLab can publish them before it
  refuses the summary, and report the outcome as unknown otherwise.
  A rollback that leaves drafts reports how many may remain.
- Place comments on files GitLab collapsed through the diff compared
  from their texts, and let a file's new path name it over another
  file's old path after chained renames.
- Keep the final newline of raw file reads.
- Apply maxOutputBytes to the complete review result, and report a
  read whose rights stop early or skip a discussion's later notes as
  truncated.
- Serve a version over maxCachedVersionBytes without keeping it.
- Resolve uploaded avatars GitLab names by their path on the host.
- Schedule bounded reads through p-limit.

* fix(forge-session): run lookups only for live command rules and keep the projection registered

- Reference lookups use the rules of live registrations, so a disposed
  provider's rule still folds but starts no gh or glab process.
- A failed re-registration registers the projection again with the
  earlier rules, so clients keep its view; an error is logged only when
  that fails too.
- Document the startup re-registration, test that the checkpointed
  state version survives a real Loader start, shutdown, and restart,
  and record that starting without a provider removes the bindings only
  its commands made.
- Describe the changes view's pending review and single comment
  without naming GitHub, which keeps its own rule in forge-github, and
  render registerCommands as code in the generated service reference.

* fix(forge-bundle): name GitLab merge requests in the bundle description

The bundle now follows GitLab merge requests as well as GitHub pull
requests, so the description's first sentence in every locale names
both kinds of change request.

* feat(forge): bind the change requests that gh api and glab api requests name

Models often read a merge request through `glab api` or a pull request
through `gh api` instead of `glab mr view` or `gh pr view`, which left
the change request unbound. A command rule now declares raw API request
subcommands beside its reference subcommands, each group with its own
options, since `-f` is a value of `gh api` and a flag of
`gh pr checkout`.

An API request binds, as referenced, only the change request its REST
path names, such as `projects/group%2Fapp/merge_requests/7/changes` or
`repos/octo/demo/pulls/7/files`; its output is not read, since one
request can list many change requests. A path whose host the command
names binds directly, and one without a host, or with the current
repository's placeholders, resolves through the CLI's view command in
the call's shell. The gh and glab rules move to version 2.

* docs(forge): add forge-gitlab and the forge-session peers to the module graph

Regenerate docs/module-graph for the renamed GitLab provider and the
optional forge-session peer of both providers.

* test(web): refresh the forge bundle description in the recommended plugin catalog

The creation recommendation recording carries every recommended
plugin's description; refresh it for the forge bundle description that
now names GitLab merge requests and the glab sign-in.

* chore(forge-gitlab): carry the 0.2.2-rc.3 release version and move upgrade guides to v0.2.2-rc.3
2026-11-13 07:56:57 +00:00
LegGasai 0a81f5bbea Merge remote-tracking branch 'origin/master' into worktree/forge-m7-review-page-ee17bf
# Conflicts:
#	packages/client/ui-conversation/README.i18n.yaml
2026-11-11 19:53:43 +08:00
LegGasai 86b7aef42c docs(forge): document the code review page
Describe the page in the panel and conversation READMEs and the forge
subsystem page, record the decision in an Agent Note, and regenerate the
configuration, Cordis, and slot catalogs.

Refs #8312
2026-11-11 19:13:03 +08:00
LegGasai f71ee7cb2e feat(forge): list the signed-in user's change requests and read descriptions
ForgeProvider gains an optional viewer capability with listForViewer and
countForViewer, which read the review-requested, authored, and involved
lists of open change requests on a host, and readDescription, which reads
a change request's Markdown description, labels, and image addresses a
browser can load without a host session. ForgeFailure.code gains
rate-limited.

forge-github reads each list through one GraphQL search (one document
that searches several lists draws a gateway error), counts all lists in
one request, pairs uploaded images with the signed addresses of the
rendered description, and reports GitHub rate limits as rate-limited.

Refs #8312
2026-11-11 17:22:08 +08:00
LegGasai 7bd01e1e29 Merge remote-tracking branch 'origin/master' into feat/session-panel-sections
# Conflicts:
#	apps/web/tests/jobs-panel-layering.e2e.ts
#	apps/web/tests/sidebar-subagent-activity.e2e.ts
#	apps/web/tests/subagent-conversation.e2e.ts
#	apps/web/tests/support.ts
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	docs/subsystems/forge.i18n.yaml
#	packages/client/README.i18n.yaml
#	packages/client/ui-jobs/package.json
#	packages/client/ui-subagent/package.json
#	packages/client/ui-subagent/src/client/index.ts
#	packages/client/ui-subagent/tests/conversation-ui.client.spec.tsx
#	packages/client/ui-subagent/tsconfig.json
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/package.json
#	packages/experimental/client-ui-forge/src/client/ChangeRequestCard.tsx
#	packages/experimental/client-ui-forge/src/client/ChangesTab.tsx
#	packages/experimental/client-ui-forge/src/client/ForgeTab.tsx
#	packages/experimental/client-ui-forge/src/client/mount.ts
#	packages/experimental/client-ui-forge/tests/forge-tab.client.spec.tsx
#	packages/experimental/client-ui-forge/tests/mount.client.spec.ts
#	packages/extensions/cordis-client-runner/src/client/slot-catalog.ts
#	packages/preset/agent-preset/skills/dsh-doc/references/packages.md
#	pnpm-lock.yaml
2026-11-11 16:34:53 +08:00
Yichen Jiang 30e56b50bb Merge remote-tracking branch 'origin/master' into fix/forge-ptc-binding
# Conflicts:
#	apps/web/tests/forge-panel.e2e.ts
2026-11-11 14:41:33 +08:00
Yichen Jiang d429d1b00d fix(forge-session): 关联 PTC 程序内 shell 调用操作的 PR
PTC 程序内的工具调用只写 tool/ptc-dispatch-start / tool/ptc-dispatch
事件,不写 tool/call / tool/result,因此 forgeChangeRequests 投影看不到
程序内的 gh pr create/view/edit/checkout 与 git push;reference-lookup
又跳过带 parent 的嵌套调用。

- 投影折叠 bash / pwsh 的 tool/ptc-dispatch 事件,复用直接调用的绑定
  与推送规则;stateVersion 3 -> 4,旧检查点重新折叠。
- 服务对 tool/ptc-dispatch 事件触发推送发现并刷新监听方。
- 嵌套调用的不带主机数字引用排队到外层根调用结算后查询,
  使用原调用的 shell 执行环境,随根调用取消。
- 单测、Loader 真实 PTC 组合测试与 Web e2e 覆盖 PTC 路径。

Fixes #8290
2026-11-11 13:05:51 +08:00
Yichen Jiang f1f987c4c2 docs(forge): name what review changes reread, when annotations draw, and brand lens ids 2026-11-11 11:34:04 +08:00
Yichen Jiang aae5b719a9 docs(forge): document the extension API and replay a fixture extension
Add the forge subsystem's extension API section, README and cookbook
coverage, the generated Cordis, config, slot, and event catalogs, and a
recorded forge-panel e2e case that loads a fixture plugin registering a
lens, annotations, and every new slot.
2026-11-10 14:53:09 +08:00
LegGasai beba76079e Merge remote-tracking branch 'origin/master' into feat/session-panel-sections
# Conflicts:
#	apps/web/tests/expected/forge-panel/local-and-pr.expected.md
#	apps/web/tests/expected/forge-panel/panel.expected.md
#	apps/web/tests/forge-panel.e2e.ts
#	docs/subsystems/forge.i18n.yaml
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/src/client/ChangeRequestCard.tsx
#	packages/experimental/client-ui-forge/src/client/DiffFile.tsx
#	packages/experimental/client-ui-forge/src/client/Forge.module.css
#	packages/experimental/client-ui-forge/src/client/ForgeTab.tsx
#	packages/experimental/client-ui-forge/src/client/mount.ts
#	packages/experimental/client-ui-forge/tests/change-request-card.client.spec.tsx
#	packages/experimental/client-ui-forge/tests/forge-tab.client.spec.tsx
2026-11-10 12:14:35 +08:00
LegGasai 2ce65c759f Merge commit '796d33c30ca' into feat/session-panel-sections
# Conflicts:
#	.agents/notes/implemented/feature/2026-10-09-forge-panel.i18n.yaml
#	docs/subsystems/forge.i18n.yaml
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/src/client/mount.ts
2026-11-09 21:18:17 +08:00
Yichen Jiang ef22fbe7d3 fix(forge): report unconfirmed writes and harden the overview actions
- ForgeActionFailure gains `unknown` for an answer that does not confirm
  the outcome; the GitHub provider passes it on instead of `failed`, the
  panel Remote refuses with `forgePanel/action-unknown`, a viewed mark
  stays, and the other actions ask the reader to check the browser.
- Reruns skip workflow runs with a pending check, try every finished run,
  and report the refused ones together; the card offers a rerun only when
  a failed check's run has finished.
- Review requests resolve users and teams to node ids and call
  `requestReviews`, which GitHub Enterprise Server 3.19 and 3.20 have;
  bots still go through `requestReviewsByLogin`.
- Viewed marks are kept per change request and head, so a reread at the
  same head keeps writes in flight and their locks, and paths named after
  object properties read only their own entries.
- The reviewer search never chooses from the listing of an earlier query.
- Documentation states the unknown code, the branch update evidence, and
  the `canBeRebased` approximation, and drops stray blank lines.
2026-11-09 20:56:46 +08:00
Yichen Jiang b1fae5b326 docs(forge): document the overview and viewed marks
The forge subsystem page gains the overview and viewed mark types and
contracts, and the generated Cordis, configuration, and event catalogs
follow the new service methods and the maxViewedFiles option.
2026-11-09 17:13:17 +08:00
Yichen Jiang 28df6c3117 Merge remote-tracking branch 'origin/feat/forge-review-threads' into feat/forge-review-writes
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/src/client/ChangesTab.tsx
#	packages/experimental/forge-github/README.i18n.yaml
#	packages/experimental/forge-github/README.md
#	packages/experimental/forge-github/README.zh.md
#	packages/experimental/forge/README.i18n.yaml
#	packages/experimental/forge/src/index.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
2026-11-09 14:53:18 +08:00
Yichen Jiang dacbc37209 Merge remote-tracking branch 'origin/master' into feat/forge-review-threads
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/src/client/ChangesTab.tsx
#	packages/experimental/client-ui-forge/src/client/DiffFile.tsx
#	packages/experimental/forge-github/README.i18n.yaml
#	packages/experimental/forge-github/README.md
#	packages/experimental/forge-github/README.zh.md
#	packages/experimental/forge/README.i18n.yaml
#	packages/experimental/forge/src/index.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
2026-11-09 14:28:39 +08:00
LegGasai 65f2344993 Merge commit '3778faaa5f2' into feat/session-panel-sections
# Conflicts:
#	apps/web/tests/subagent-conversation.e2e.ts
#	docs/subsystems/forge.i18n.yaml
#	docs/subsystems/forge.md
#	docs/subsystems/forge.zh.md
#	packages/client/ui-subagent/README.i18n.yaml
#	packages/client/ui-subagent/README.md
#	packages/client/ui-subagent/README.zh.md
#	packages/client/ui-subagent/src/client/SubagentHeaderLineage.tsx
#	packages/client/ui-subagent/tests/conversation-ui.client.spec.tsx
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/package.json
#	packages/experimental/client-ui-forge/src/client/mount.ts
2026-11-09 14:13:43 +08:00
Yichen Jiang 6e882cd6e3 fix(forge): confine review writes to the bound pull request and reconcile unknown submissions
A write to a thread or comment now reads, in the head check, the pull
request that holds it and is refused without a mutation when that is
another pull request. Submitting the pending review keeps the
submission to reconcile, so an unknown outcome blocks a second review.
GraphQL errors count as refusals only when every type names one, so a
GitHub timeout reports an unknown outcome. Pending reviews are found
by viewerDidAuthor among up to 100, without the unused commit field. A
resolved thread stays open while the reader writes in it, unsupported
writes no longer poll, and the docs state the partial two-step write.
2026-11-09 14:08:22 +08:00
Yichen Jiang 9f875cf44d Merge remote-tracking branch 'origin/feat/forge-review-threads' into feat/forge-review-writes
# Conflicts:
#	apps/web/tests/forge-panel.e2e.ts
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/subsystems/forge.i18n.yaml
#	docs/subsystems/forge.md
#	docs/subsystems/forge.zh.md
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/src/client/ChangesTab.tsx
#	packages/experimental/client-ui-forge/src/client/mount.ts
#	packages/experimental/client-ui-forge/src/client/thread-state.ts
#	packages/experimental/client-ui-forge/src/index.ts
#	packages/experimental/client-ui-forge/tests/changes-tab.client.spec.tsx
#	packages/experimental/client-ui-forge/tests/mount.client.spec.ts
#	packages/experimental/client-ui-forge/tests/review-cache.host.spec.ts
#	packages/experimental/client-ui-forge/tests/review.host.spec.ts
#	packages/experimental/forge-github/README.i18n.yaml
#	packages/experimental/forge-github/src/threads.ts
#	packages/experimental/forge-github/tests/threads.spec.ts
#	packages/experimental/forge/src/types.ts
#	packages/experimental/forge/tests/registry.spec.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
2026-11-09 13:03:22 +08:00
Yichen Jiang 1ba5977691 fix(forge-panel): address the review thread findings
- A jump to a thread centered its card on every later jump to the same file, since the jump target outlived the jump.
  The scroll target now carries the card to center and is cleared when the jump ends; unfolding still follows the
  latest thread jump.
- In a commit range view, a thread on a file the chosen commits do not change opened on the host instead of choosing
  all commits; a thread the chosen commits do not hold now always chooses all commits first.
- A quote of an old-side thread named the head as the commit its lines number. It now says the lines number the file
  before the change and names the head only as where the diff ends, and ForgeAnchor documents the same.
- Refresh reads review threads from the host past the panel's cache (`changeRequestReview` takes `fresh`), so a thread
  resolved since shows without waiting for `reviewRefreshMs`; `maxCachedReviewBytes` defaults to 16 MiB, at least
  one read under forge-github's default `maxOutputBytes`.
- Picking a thread from a list that covers the files moves the focus to the thread's card.
- `ForgeReviewData.viewer`, its GraphQL field, `ThreadActions.viewer`, and `ThreadReadState.unsupported` had no
  consumer and are removed.
- A quoted outdated thread is named by the lines it was written on; a missing pull request or repository makes a
  review read `not-found`; a truncated read that kept no thread still offers the thread list.
2026-11-09 12:50:33 +08:00
Yichen Jiang c04c40b68a docs(forge): document review writes and record pending review drafts
The forge subsystem page documents ctx.forge.writeReview, its write
and result types, and the panel's changeRequestReviewWrite; the package
READMEs describe the GitHub mutations and their measured behavior, the
thread actions, and the pending review flow. A new Agent Note records
moving pull request comment drafts to the code host's pending review,
and the forge panel note links it. The Web e2e replies to, edits,
deletes, and resolves threads, and starts, submits, and discards a
pending review through the scripted gh double.
2026-11-09 11:38:56 +08:00
Yichen Jiang 9b456b4e93 perf(forge): compare from the recorded base while confirming the head
Status snapshots carry the base commit the host recorded with the head
(baseSha). ForgeService.diff passes it to the provider when the latest
status names the requested head, and forge-github starts the compare read
from it while its GraphQL read confirms the head; a stale head or another
base cancels and joins the early read.
2026-11-07 16:22:24 +08:00
Yichen Jiang f11daf3ad3 docs(forge): document review thread reads, the thread overlay, and the unsupported failure
The forge subsystem page documents ctx.forge.readReview, its thread
types, and the panel's changeRequestReview cache; the package READMEs
describe the GitHub thread mapping, the overlay and thread list, and the
new panel Config fields. An upgrade guide covers the unsupported
ForgeFailure code. The Web e2e overlays scripted threads, opens them from
the thread list, and sends a quoted thread through a replayed turn.
2026-11-07 14:31:30 +08:00
Yichen Jiang ef34a844de fix(forge-panel): refuse commit runs off the first-parent line and harden review state
- Shift-chosen commits must follow each other as first parents; the picker
  says why it keeps a run that leaves the line, and the Host refuses one with
  forgePanel/commits-not-linear for the Branch scope and change requests.
- The Branch scope lists its newest maxCommits commits with
  --no-show-signature, so log.showSignature cannot corrupt the listing.
- Viewed marks merge with the stored entry on each write and follow the
  storage event, so tabs of one Session keep each other's marks.
- .gitattributes patterns follow Git's wildmatch rules, checked against
  git check-attr; change digests include file mode lines.
- GitHub commit pagination refuses a repeated cursor or a changed count;
  commits validates the repository before its host like the other reads.
- The commit list is read once per head, base, or refresh; the lens menu
  hides the count of the disabled Tests lens.
2026-11-07 12:56:23 +08:00
Yichen Jiang fb637c2bfd Merge remote-tracking branch 'origin/master' into feat/forge-review-viewed-lenses
# Conflicts:
#	apps/web/tests/forge-panel.e2e.ts
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/subsystems/forge.i18n.yaml
#	docs/subsystems/forge.md
#	docs/subsystems/forge.zh.md
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/src/client/ChangesTab.tsx
#	packages/experimental/client-ui-forge/src/index.ts
#	packages/experimental/client-ui-forge/tests/controller.host.spec.ts
#	packages/experimental/forge-github/README.i18n.yaml
#	packages/experimental/forge-github/README.md
#	packages/experimental/forge-github/README.zh.md
#	packages/experimental/forge-github/src/index.ts
#	packages/experimental/forge-github/src/provider.ts
#	packages/experimental/forge-github/tests/plugin.spec.ts
#	packages/experimental/forge-github/tests/provider.spec.ts
#	packages/experimental/forge-github/tests/review.spec.ts
#	packages/experimental/forge/README.i18n.yaml
#	packages/extensions/tool-cordis/src/api-catalog.ts
2026-11-07 12:13:56 +08:00
LegGasai 1eb24252ad Merge the feat/session-panel head into feat/session-panel-sections 2026-11-07 11:41:36 +08:00
Yichen Jiang 0e971200c4 feat(forge-panel): let repositories declare review layers in .gitattributes
A repository's root .gitattributes now decides a file's review layer first:
dsh-review-layer names test, interface, or implementation, and
linguist-generated still places a file in the test layer. The testPaths and
interfacePaths settings add globs before the built-in rules and are empty by
default. The built-in rules follow the default conventions of common
languages and tools instead of treating every JSON or YAML file and every
name containing config as interface. This repository declares its own locale
dictionaries, snapshot tree, pairing records, and types modules.
2026-11-06 18:47:22 +08:00
Yichen Jiang e07b170d77 fix(forge): address review of pinned diffs and thread counting
- forge-github: repeat a compare read without --allow-escape-sequences when
  a gh older than 2.97 rejects the option; such a gh prints escape sequences
  unchanged, so every version reads every diff (checked with gh 2.96.0 and
  2.100.0 on a pull request whose patch holds an ESC byte).
- client-ui-forge: a stale refusal now re-runs the read effect, so a status
  that arrived during the read, including a failed poll that keeps the
  earlier head, starts the next read at once instead of leaving the changes
  view loading.
- forge: ctx.forge.diff polls at once only for the first stale read at a head
  commit; later stale reads at it wait for the regular poll, which bounds the
  read-poll loop while GitHub's answers briefly disagree.
- forge-github: review thread pages share the byte budget of a complete
  check read.
- client-ui-forge: a truncated count shows its "+" even when it is zero.
- READMEs: document the batch deadline and rewritten-base limitations.
2026-11-06 18:17:04 +08:00
Yichen Jiang c313392bf8 feat(forge-panel): review changes by layer, mark files viewed, and view chosen commits
The changes view gains a lens of All, Interface, Implementation, and Tests
that spans the file tree above it, a switch that hides test files from the
tree and the diff, and a viewed checkbox on each file header that collapses
the file. The toolbar counts viewed files and V toggles the file being read.
Marks are kept per Session, source, path, and change digest in browser
storage, so a file that changes again reads as changed since viewed. All
commits beside Submit review, and beside the base branch of the Branch scope,
shows one commit or a Shift run of commits.
2026-11-06 17:51:22 +08:00
Yichen Jiang 94336c6b3d fix(forge): pin change request diffs to the polled head and count every review thread
ForgeProvider.diff now takes the head commit it must describe. The GitHub
provider reads headRefOid before and after `gh pr diff` and returns the new
ForgeFailure code `stale` when either read names another commit, so the
forge panel never caches a patch under a head it does not describe. A stale
read polls the change request at once, and the changes view waits for the
next status before reading again.

Status polling pages reviewThreads up to the new `maxReviewThreads` setting
(default 1,000) instead of counting only the first 100, and sets
ChangeRequestSnapshot.threadsTruncated when the count is a lower bound.
2026-11-06 16:15:24 +08:00
LegGasai 08529b599c Merge branch 'feat/session-panel' into feat/session-panel-sections 2026-11-06 11:06:18 +08:00
LegGasai 4f3b71a4e9 feat(web): move change requests into the Session panel
The forge panel's right-sidebar tab, its header button, and its start-page
entry are replaced by Session panel entries: a Change requests section
with its count and refresh, checkout and local changes rows plus a refresh
in the Environment section, and an attention mark on the panel toggle.
Change request cards keep their expandable rows and move their actions
into a More menu; Merge stays below the rows.

Environment rows receive the section owner values so a row that opens the
sidebar can close the overlay, and PanelRow gains an action label for its
button.
2026-11-05 21:32:00 +08:00
Yichen Jiang 691ebd7b6c refactor(worktrees): move archive cleanup into the worktree service
The worktree service now records each checkout it creates as a
`plugin:worktree/created` record, folds them in its own `worktree`
projection with fork-aware ownership, and reclaims a clean, unreferenced
checkout when the Session that created it is archived. The Forge panel
reads the service's record and forwards its cleanup state; it no longer
writes a `created` record, owns a retention projection, or gates every
Session's directory access.

Admission registers the attempt inside the Workspace write queue and
returns; inspection runs afterwards, reading cold Sessions through the
projection cache when mounted and from their log otherwise, with subagent
children of an archived ancestor counted as archived. Only a path being
removed holds `working-directory/access`, whose request now carries the
access's `signal`, and listeners withdraw before the drain. Ignored files
no longer retain a checkout, matching Git's non-force removal; processes
and terminals are not consulted.

The Forge bundle mounts one `worktree` service: the `forge-worktree` row
and the `optional-forge-panel` group that isolated a second service are
gone, and `forge-panel` is a top-level row. `canRemove`, `remove`, the
`forgeWorktreeRetention` projection, and `ForgeWorktreeCleanup` are
removed; `WorktreeService.cleanupOf`, `WorktreeCleanup`, and the
`worktree/cleanup` Host event replace them. The upgrade guide moves to
the current version directory and covers the id removals.
2026-11-05 12:28:50 +08:00
Yichen Jiang a2d8340421 Merge origin/master into worktree/archive-session-worktrees 2026-11-05 11:45:46 +08:00
Yichen Jiang a703e9e4b0 fix(forge): address review of the base branch picker
Identify a local review comparison by its compared ref instead of the
displayed base name. Branch records stored before this change appear in
the automatic comparison again, and comparisons that share a name, such
as a worktree start and a local branch, stay apart.

List base branch refs within maxDiffBytes, so a repository with more refs
than maxOutputBytes allows keeps a working menu, and document the
remaining limit.

Move the merge button fill toward the label color so its label reaches
4.5:1 contrast in both themes, name the automatic menu group, and drop an
unused DOM attribute.

Refs #7781
2026-11-03 15:52:36 +08:00
Yichen Jiang 61addcbcb9 Merge remote-tracking branch 'origin/master' into worktree/forge-diff-base-branch-4ffd61 2026-11-03 13:49:51 +08:00
Yichen Jiang fcc1becf11 feat(forge): choose the base branch of local changes
The Branch scope of the local changes view compared only with the
automatic fork point. Its header now names the checked-out branch and a
searchable base branch menu that lists the automatic fork point, then
remote-tracking and local branches; a chosen branch compares with its
merge base with HEAD. The choice lives in the view tab, a missing or
unrelated branch offers the default instead of a retry, and local Branch
review quotes name the base they were compared with.

Refs #7781
2026-11-03 13:49:13 +08:00
Yichen Jiangandimccyu d721353f86 feat(forge): unify plugin entry for reviews and worktrees (#7721)
* feat(forge): unify the worktree plugin entry and add user previews

* docs(forge): show session-linked GitHub pull requests in preview

* refactor(forge): keep plugin unification out of profile loading

* docs(forge): document manual upgrade to the unified plugin entry

* fix(forge): localize preview descriptions and address review feedback

* test(web): refresh creation recommendation catalog for the forge description

---------

Co-authored-by: imccyu <[email protected]>
2026-11-02 22:34:01 +08:00
Yichen Jiang 0f1a3e68a0 Merge remote-tracking branch 'origin/master' into worktree/archive-session-worktrees
# Conflicts:
#	apps/web/tests/forge-panel.e2e.ts
#	packages/client/ui-workspace/tests/apply.client.spec.ts
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/src/client/locales.ts
#	scripts/type-equiv.manifest.json
2026-10-29 16:31:47 +08:00
Yichen Jiang dc169c71e7 Merge pull request #7482 from deepseek-harness/worktree/forge-review-navigation-checks
fix(forge): deduplicate checks and improve review navigation
2026-10-29 11:47:17 +08:00
Yichen Jiang 4f40200ed8 fix(forge): clarify filter failures and query guarantees 2026-10-29 11:16:34 +08:00
Yichen Jiang f08ad306cc fix(forge): load complete checks on demand per pull request 2026-10-29 11:10:35 +08:00
Yichen Jiang 2b9511548b fix(forge): honor session permissions for Git inspection 2026-10-28 16:54:20 +08:00
Yichen Jiang bd1c30cd81 feat(forge): add file tree and inline review comments 2026-10-28 11:42:45 +08:00
Yichen Jiang 5c37ee0163 feat(worktrees): clean up safe UI checkouts when sessions are archived 2026-10-27 12:57:10 +08:00
Yichen Jiang e99a597b16 fix(forge): drain list state streams and refresh reopened requests 2026-10-26 21:22:30 +08:00