Repository navigation
feat(tools): route the remaining write tools through the guard (U7, #1375) #1918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
easonLiangWorldedtech
wants to merge
123
commits into
Zoo-Code-Org:main
Choose a base branch
from
easonLiangWorldedtech:fws/u7-tool-wiring
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
123 commits
Select commit
Hold shift + click to select a range
9c8f22c
split unit U1 of PR 1833 (issue 1375)
01ce717
fix(file-safety): close the pre-merge findings on the publish primiti…
3db295c
fix(file-safety): propagate a non-ENOENT lstat failure in resolvePubl…
b376fcc
fix(file-safety): keep the rollback pair typed and the mock stand-ins…
263ccfd
rebuild unit u2 on the fixed chain
ff07b09
rebuild unit u4 on the fixed chain
73f4046
rebuild unit u5 on the fixed chain
9121a29
rebuild unit U8 on U5 (corrected merge order)
6d9070a
rebuild unit u6 in the corrected order
2c4b935
fix(apply-patch): a full hunk read is a complete observation
1801948
rebuild unit u7 on the corrected u6
43aa804
rebuild unit U7 on the corrected U6
3f1e274
fix(task): keep main's abort re-check in ask
f1bdd5f
fix(file-safety): inherit unit 1 committed guard
85dad24
fix(file-safety): keep the publish error message in RollbackFailureError
997a4a2
test(file-safety): assert the exact staging directory removed after a…
81e2575
test: re-run mocked e2e and the ubuntu lane - no source change since …
f422e84
fix(file-safety): give the Windows DACL dump a per-write name
2950c64
fix(tools): carry U1's hunk-read completeness rule into this unit
e38fd91
fix(tools): bring U7 onto the current file-safety core
03e3821
chore: trigger a fresh review pass at this head
7543fb6
fix(integrations): preview observation must not authorize a save; asy…
a9471eb
fix(tools): ApplyDiffTool must observe the version its diff was built on
9497c1c
test(tools): type the apply_diff observation doubles for check-types
96e6b77
fix(integrations): never adopt an autosaved match for an unauthorized…
485220b
fix(tools): never refresh a model observation the tool read on a diff…
a6afdfb
fix(safety): confine before the lock, keep the post-commit backup
3ee36e6
fix(safety): confine before mkdir, report the retained backup, stop p…
ad1b313
fix(tools): honor an approval for a write outside the task root
e67ba39
fix(u7): no containment decision without a canonical workspace, and n…
dc399b3
fix(file-safety): one lock key whether the parent directory exists yet
b5ce327
test(file-safety): a backup copy that fails part-way must not survive…
2ffe505
test(tools): pin which bracketing stat fails in the diff-read observa…
04be71b
fix(diff-view): put the save's post-publish cleanup inside the same t…
930eb4b
fix(diff-view): let only the teardown that started a pass finalize th…
e77df9c
fix(diff-view): restore preview tabs for the pass that owns a rejecte…
7b93cd8
fix(tools): pass the outside-workspace approval flag in its own position
355ba19
fix(guardedWrite): one unresolvable workspace folder must not veto ev…
72fd3ae
fix(guardedWrite): bind an approved outside-workspace write to the id…
6c2ac36
fix(diff-view): keep the teardown guard held through the finalization…
2dfc8f1
fix(write-to-file): resolve the approved identity inside the tool's e…
5d8f99c
test(tools): keep the outside-workspace flag reset on the failure path
1983440
fix(diff-view): finalize the session when a cancellation lands during…
2a38e5d
fix(diff-view): one caller owns the session's finalization, by claim …
39204a2
fix(test): clear the merge artifacts on the U9 branch
ec92e11
test(safety,tools) and refactor(apply-patch): make four tests prove w…
5852442
style: format the fifteen files the formatting gate flags on this PR
93c36e8
fix(u7): align the unit with main's lint re-enable and format gate; d…
easonLiangWorldedtech 71440eb
fix(editor): withdraw the preview observation on every exit path
easonLiangWorldedtech 0f049ab
fix(editor): narrow the preview task before the withdrawal forget
easonLiangWorldedtech dddf575
fix(editor): withdraw the preview entry by ownership, not content
easonLiangWorldedtech f37386b
fix(guarded-write): bind the publish to the authorized canonical target
easonLiangWorldedtech 38db765
test(tools): pass toolCallId in guarded-write spec callbacks
easonLiangWorldedtech 78e45b5
fix(guarded-write): refuse a dangling leaf link before publishing
easonLiangWorldedtech 520e42c
fix(diff-view): reconcile an already-open document after the guarded …
easonLiangWorldedtech d0f0a27
fix(diff-view): fail saveDirectly when the reconcile leaves the targe…
easonLiangWorldedtech 471f2bf
fix(diff-view): keep a dirty open buffer that differs from the guarde…
easonLiangWorldedtech 5b30439
chore(knip): mark the guarded-write chain reset hook @internal
easonLiangWorldedtech e6d472a
fix(editor): report the post-publish buffer conflict as a committed w…
easonLiangWorldedtech 565fe97
style: format the committed-write conflict assertions
easonLiangWorldedtech 901983f
test(apply-diff): mock the stat/observation doubles the guarded read …
easonLiangWorldedtech 39052c7
fix(apply-diff): drop only the partial observation this call created …
easonLiangWorldedtech b9b8afa
test(apply-diff): complete the denial fixture and assert no tool error
easonLiangWorldedtech 8a1f1ee
fix(fws-u7): scope the clipped-read notice and re-check the lock unde…
easonliang28 143a135
fix(fws-u7): re-verify the staging directory before the staged write
easonliang28 117c0a6
fix(utils): canonicalize both sides of the staging-directory drift check
easonLiangWorldedtech eadd52d
test(utils): type the hoisted fs actuals by the callback return type
easonLiangWorldedtech c1919da
fix(utils): treat an unanswered drift probe as no evidence of drift
easonLiangWorldedtech 1268259
fix(#1918 r112): narrow four over-broad behaviours flagged in review
easonLiangWorldedtech 2fbae51
fix(#1918 r112 follow-up): withdraw the source only if its unlink rem…
easonLiangWorldedtech 8514bd7
test(tools): reset the write_to_file doubles in a finally block
easonLiangWorldedtech 98a5959
test(tools): pin the flag-off apply_patch move as the unguarded raw w…
easonLiangWorldedtech cd44ee3
test(utils): let the staging-directory leftover assertions see a stag…
easonLiangWorldedtech 6cd6e18
test(tools): exercise observation-registry isolation through ReadFile…
easonLiangWorldedtech d1e2d7b
fix(file-safety): compare staging containment by directory identity, …
easonLiangWorldedtech 03dfe25
fix(utils): create the JSON staging file with the publish target's mode
easonLiangWorldedtech e9fdbbf
test(file-safety,utils): keep the new staging rows typeclean
easonLiangWorldedtech 88273b0
fix(safeWriteJson): treat an empty confineTo as a declared scope (#19…
easonLiangWorldedtech c090808
fix(readFileTool): stop the clipped-line notice indenting the first n…
easonLiangWorldedtech fb0c4cf
fix(diffView): reconcile the file document when a virtual document sh…
easonLiangWorldedtech 6beedc8
test(guardedWrite): show that a blocked publish does not hold other p…
easonLiangWorldedtech 48f0b6c
test(guardedWrite): cover resetChain while a link is still publishing…
easonLiangWorldedtech 3220b1a
test(safeWriteJson): show nothing is staged before the lock is held (…
easonLiangWorldedtech 82304c6
test(writeToFileTool): assert the canonical target reaches both save …
easonLiangWorldedtech e7f16f8
fix(safe-write): answer the lock-key drift guard with lock identity, …
easonLiangWorldedtech 7134b3a
docs(safe-write): record what the confineTo presence test decides, an…
easonLiangWorldedtech ec7bcad
test(file-safety): compare the aliased directory by identity, not by …
easonLiangWorldedtech c84278b
fix(safe-write): keep the validated staging file protected through th…
easonLiangWorldedtech bc129c7
fix(diff-view): close the tab the opener recognized, using the same c…
easonLiangWorldedtech 1299f27
fix(apply_patch): refuse a file whose bytes cannot be decoded instead…
easonLiangWorldedtech a150900
fix(diff-view): carry a failed teardown to the cancellation that join…
easonLiangWorldedtech 802352d
S4b (#1375): a committed publish is not undone by a cancellation
easonLiangWorldedtech 13a943d
S4b (#1375): a committed write that is not durable keeps its authoriz…
easonLiangWorldedtech dec06df
S4b (#1375): name the rejection the committed-publish rows were asser…
easonLiangWorldedtech 6378aa8
S4b (#1375): create the directory the lock needs before taking the lock
easonLiangWorldedtech 85be578
test(S4b #1375): pin the publish-side claims the review rows named
easonLiangWorldedtech 34cd960
test(S4b #1375): make the two lane-red rows ask the same question on …
easonLiangWorldedtech 258c5fe
test(S4b #1375): put the lock-key rows on the question the guard actu…
easonLiangWorldedtech 0e8af36
test(S4b #1375): sort the acceptance row's four-name list and make it…
easonLiangWorldedtech 56ce2d2
test(utils): pin withFileLock's release-on-rejection contract, includ…
easonLiangWorldedtech 9d3c437
test(utils): make the artefact-stat propagation row assert that its o…
easonLiangWorldedtech 4eb4c6a
fix(utils): take the delete lock on the key the writer publishes under
easonLiangWorldedtech 8b098c5
fix(utils): apply the publish target's mode to the staging fd, past t…
easonLiangWorldedtech f4ebbdb
test(utils): gate the artefact-stat propagation row on a measured vol…
easonLiangWorldedtech b04b676
fix(file-safety): resolveLockKey stops handing callers a key it could…
easonLiangWorldedtech 46a86b7
fix(apply-patch): refuse a move whose destination names the file it m…
easonLiangWorldedtech d7f3146
fix(diff-view): the committed-revert teardown says which state it end…
easonLiangWorldedtech e1260e9
test(apply-patch): cover the move refusal under both preventFocusDisr…
easonLiangWorldedtech 14dde93
test(task-history): the delete rows compare files, not path spellings
easonLiangWorldedtech 4eaac3f
Stop the placeholder identity coming from the path it stats (upstream…
easonLiangWorldedtech 8e165bc
fix(editor)(#1918 u150): join an in-flight finalization before claimi…
easonLiangWorldedtech 3807c8a
fix(file-safety)(#1918 u151): restrict the staging directory before w…
easonLiangWorldedtech 5dd5ce9
u7 tool-wiring: re-land this line's ground under the trunk lock spelling
easonLiangWorldedtech fbec995
fix(u7): re-land the outside-workspace spec and the read-file lines t…
easonLiangWorldedtech a4e8363
fix(safe-write-json): lock the key every other writer to the file uses
easonLiangWorldedtech fcd9500
test(utils): state where a write through an alias lands
easonLiangWorldedtech ca208a2
test(file-safety)(#1918 u159): compare the staging parent on the foot…
easonLiangWorldedtech 7f600ee
test(utils)(#1918 u159): inject the interruption fault at the resolve…
easonLiangWorldedtech c83e96c
test(editor)(#1918 u161): pin the finalizeSession claim window throug…
easonLiangWorldedtech 69776b1
fix(tools): keep host paths out of guarded-write rejections (U7, #1375)
easonLiangWorldedtech 6a22fff
fix(tools): keep an absolute caller spelling out of the link rejectio…
easonLiangWorldedtech 932c9a4
Answer the review rows a change can answer at 6a22ffff
easonLiangWorldedtech bafdf4d
Answer the three review rows at 932c9a45 with the cases they name
easonLiangWorldedtech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refuse undecodable files before recording the observation, as
ApplyPatchToolnow does.Line 97 reads with
"utf-8", which replaces invalid byte sequences with U+FFFD. The diff is applied to that text. The"edit"save then publishesdiffResult.content, so bytes the diff never touched are rewritten as U+FFFD. Line 112 records the version of the original bytes, so the compare-and-swap accepts the save.This PR gives
ApplyPatchTool.readFilea different rule. It decodes withnew TextDecoder("utf-8", { fatal: true })and refuses a publishable read before it records an observation. The lossy write inapply_diffpredates this PR. However, the two write tools now treat the same file differently. Read the bytes, decode them with the fatal decoder, and return a tool error before observing.