Roots::check now makes the path absolute, removes its `.` and `..` names
from the text, and compares it with each root as given and as resolved
before any file system call. Every path outside the roots gets the same
Outside error, whether or not something exists there. On Windows and
macOS names that differ only in case match in this step.
When a path inside a root cannot be resolved and a link in it leads out
of the roots, including a chain of links to nothing, the error is
Outside too, so the error does not tell what exists outside the roots.
std::path::absolute turns //?/ and //./ into \?\ and \.\, so a path
such as //?/GLOBALROOT/Device/Mup/server/share/x passed the name rules
as written and reached the file system. Roots::check and Roots::new now
apply the rules again to the absolute form before any file system call.
On Windows, Roots::check now reads the path's text before any file
system call. A path on a network share (\server\share or
\?\UNC\server\share, also after a relative path is made absolute) is
refused unless a root of the requested kind is on the same server and
share, so a refused path does not open a connection to another
computer. Paths that start with \??\ are refused like \.\ paths, and
roots are checked against the name rules before they are opened.
A link or junction can lead to a folder whose name the Windows rules
refuse, such as one that ends in a dot. Roots::check now checks the
path it returns, with its links followed, against the same rules, so a
path it returns passes check again. Roots::new refuses a root whose
resolved path breaks them, instead of accepting a root under which
every path would be refused.
roots::Roots holds the folders an MCP server's tools may read from and
write to. Roots::check makes a path absolute, follows its links (for a
missing path, those of its nearest existing folder), and returns it
only when it lies inside a root of the requested kind. It refuses `..`
below a missing folder and links that lead nowhere. On Windows it
refuses device names such as CON, NUL, COM1 and LPT¹, `:` in a name,
names ending in a dot or a space, `\\.\` paths, and `\\?\` paths other
than plain drive and UNC paths, so a path that check returned can be
checked again. Names with no text form are kept as they are.
Roots::required refuses to build roots without both kinds.
* craft-xlsx: typed external links, read from .xlsx and .xlsb; external references in binary formulas
ExternalLink (another workbook as ExternalBook: its target, sheet names,
defined names with refersTo and sheetId, and cached cells; a DDE or OLE link
as Other) reads from externalLinkN.xml and externalLinkN.bin alike.
Package::external_links gives one entry per Workbook::external_references,
which is now a typed field, read from externalReferences or the binary
workbook's BrtSupBookSrc records and written back from the field.
A binary formula's reference to another workbook decodes as .xlsx spells it:
[1]Data!$A$1, '[1]Other Sheet'!A1, '[1]A:C'!A1, [1]!ExtName, [1]Data!Local
for a sheet-scoped name, a DDE item [2]!'R1C1'. The link parts are read when
the workbook part is; one that can't be read, a deleted sheet of it or a name
it lacks keeps the cell's saved result.
Closes#1252.
* craft-xlsx: review fixes: external links keep their numbers, are read once, and deleted sheets keep values
- An externalReference without an r:id, or a BrtSupBookSrc whose id can't be
read, keeps its place as an empty id, so the links after it keep their
[n]; it is written back without r:id.
- A binary workbook's external link parts are read once, with its workbook
part: the formulas' index and Package::external_links share that read, so
cached cells are charged to binary_cells once.
- PtgNameX through a deleted sheet of another workbook (-1) keeps the cell's
saved result instead of falling back to the name's own scope.
* craft-xlsx: deduplicate binary external links against budget and add cache-cap test
* craft-xlsx: avoid cloning ExternalLink on duplicate binary external references
---------
Co-authored-by: kiwi4boy <kiwi4boy@gmail.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
craft-common-actions' select-platforms selects the tests: the crates that
own a changed file, the crates that declare a read of it, and every
crate that depends on them. Every nextest run gets the filter; the build
and the doctests stay whole-workspace. The build setup, a crate's own
Cargo.toml and files outside the crates other than docs run every test;
docs alone run none. pdf, svg and the fonts-build consumer declare the
files of other crates that their tests read.
An empty agent folder setting meant no file access, so an agent reached
through the launcher's MCP entry could neither open nor save a file, and
nothing told it where to put files.
- default_folder(app): Documents/ArtCraft/Agents/<App> (dirs::document_dir,
else ~/Documents), only for plain app names.
- AgentSettings::folders / folders_with: the person's own folders win; an
empty setting falls back to the default, created on first use.
- The live client's headless sessions use it (LiveConfig::default_folder).
- FOLDERS_TOOL, folders_tool, folders_answer: the tool each app offers so an
agent learns the folders it may use.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-zip: add SeekableArchive::has_duplicate_names_matching and duplicate_names
* craft-zip: use zip::ZipWriter in duplicate-names test
* craft-zip: patch second entry name in duplicate-names test
The detector took any root whose first child was a Document, so an empty
Document read as a deck with no slides instead of being damaged. It now
also needs a DocumentAtom long enough for its slide count.
import_checked names the slides that count says are missing, by position,
so a cut-short file no longer reads as whole.
TooOld no longer promises every file before PowerPoint 95: a file that
isn't a compound file is NotPpt, and no earlier file was tried.