Skip to content

Commit 192c58b

Browse files
authored
fix(share): omit private paths from editable source (#8744)
* fix(share): omit private paths from editable source * fix: include the private path rules in build image installs * fix(cli): escape the exclusion list at the terminal output boundary * fix(share): bound private path notices and normalize reported names * docs(cli): explain terminal escaping in contributor guidance * Use the public descriptions for the portable source fixtures * fix(share): silently omit private source paths * test(share): distinguish private filenames from directories * fix: recover interrupted source shares after a filename correction * fix: preserve published source ancestry across filename policy upgrades * docs: clarify local snapshot ancestry validation * test: pin v4 filename segment validation for saved bases * fix: reconcile interrupted source uploads by their confirmed IDs
1 parent c890cb3 commit 192c58b

22 files changed

Lines changed: 2649 additions & 112 deletions

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161
git worktree remove "$RUNNER_TEMP/reachability-base"
6262
- name: Report head reachability
6363
run: node scripts/check-test-reachability.mjs --report
64-
- run: node --test packages/share/tests/*.test.mjs
6564
- run: node --test scripts/check-test-reachability.test.mjs
6665
- run: node scripts/check-test-reachability.mjs
6766

@@ -646,6 +645,7 @@ jobs:
646645
chrome: "true"
647646
- run: bun run generate:catalog
648647
if: needs.changes.outputs.docs_catalog == 'true'
648+
- run: node --test packages/share/tests/*.test.mjs
649649
- run: bun run test:scripts
650650
env:
651651
HYPERFRAMES_BROWSER_PATH: ${{ steps.workspace.outputs.chrome-path }}

‎.oxfmtrc.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44
"useTabs": false,
55
"tabWidth": 2,
66
"trailingComma": "all",
7-
"printWidth": 100
7+
"printWidth": 100,
8+
"ignorePatterns": [
9+
"packages/share/src/sources/contract/path-policy.json",
10+
"packages/share/tests/fixtures/compositionSync/manifest-vectors.json"
11+
]
812
}

‎Dockerfile.test‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ ENV PATH="/root/.bun/bin:$PATH"
9797
# lockfile change and fails.
9898
COPY package.json bun.lock ./
9999
COPY packages/parsers/package.json packages/parsers/package.json
100+
# The share workspace typechecks this subpath during bun install.
101+
COPY packages/parsers/src/privatePath.ts packages/parsers/src/privatePath.ts
100102
COPY packages/lint/package.json packages/lint/package.json
101103
COPY packages/studio-server/package.json packages/studio-server/package.json
102104
COPY packages/core/package.json packages/core/package.json

‎bun.lock‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/developers/share-source.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ styles, assets, and supported Studio edit metadata. Known credential filenames
3434
history, local sharing state, and recorded render outputs stay out.
3535

3636
These are filename rules, not a secret scanner. `.gitignore` does not control
37-
source capture. Other regular files can be included even if Git ignores them.
37+
source capture. Other regular files can be included even if Git ignores them. For example,
38+
editable source can include authored files under `.github/workflows/`.
3839
Keep private material outside the project, or use `--video-only` when you do not
3940
want to upload project files. Unsupported symlinks and invalid file names stop
4041
source preparation rather than silently producing an incomplete editable project.

‎docs/packages/cli.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3509,6 +3509,7 @@ hyperframes share --manage # Open web sharing settings
35093509

35103510
Sharing uploads video only by default. `--include-source` explicitly includes portable project files, including unused and Git-ignored files; review your folder and `.hyperframesignore` first. `--video-only` remains available and cannot be combined with `--include-source`. Source inclusion must be chosen for each upload, including `--update`; `--yes` does not consent to source upload.
35113511

3512+
Known credential files, Git metadata, and private tool state stay out of editable source.
35123513

35133514
The first share requires an explicit audience: `--public`, `--team`,
35143515
`--invite-only`, or `--private`. In an attended terminal, `share` asks you to

‎packages/gcp-cloud-run/Dockerfile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ COPY packages/aws-lambda/package.json packages/aws-lambda/package.json
143143
COPY packages/gcp-cloud-run/package.json packages/gcp-cloud-run/package.json
144144
COPY packages/lint/package.json packages/lint/package.json
145145
COPY packages/parsers/package.json packages/parsers/package.json
146+
# The share workspace typechecks this subpath during bun install.
147+
COPY packages/parsers/src/privatePath.ts packages/parsers/src/privatePath.ts
146148
COPY packages/sdk/package.json packages/sdk/package.json
147149
COPY packages/sdk-playground/package.json packages/sdk-playground/package.json
148150
COPY packages/inspector/package.json packages/inspector/package.json

‎packages/share/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ can use video-only; changed source, conflicts and unexpected upload failures nee
7878
an explicit choice to omit source. The CLI exposes `--video-only` for that choice.
7979
`filesForExport` only validates already-prepared source; it does not upload.
8080

81-
The adapter uses the portable-source-v4 capture/manifest rules and
81+
The adapter uses the portable-source-v11 capture/manifest rules and
8282
multipart transport. The pinned policy, Unicode 15.1 registry (with its license),
8383
and manifest test vectors are checked into this repository. Source is captured through
8484
verified file handles; upload bytes are streamed and checked against their hash.

‎packages/share/package.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@
109109
"test": "node --test tests/*.test.mjs",
110110
"prepare": "npm run build"
111111
},
112+
"dependencies": {
113+
"@hyperframes/parsers": "workspace:*"
114+
},
112115
"devDependencies": {
113116
"@types/node": "^25.0.10",
114117
"typescript": "^5.0.0"

‎packages/share/src/sources/capture.mjs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
checkInventoryPaths,
1616
classifyPath,
1717
excludedFolder,
18+
isPrivateSourcePath,
1819
prefiltered,
1920
skippedSymlink,
2021
validatePath,
@@ -28,9 +29,16 @@ import { readRenderOutputs, settledState } from "./projectState.mjs";
2829
const INLINE_HASH_BYTES = 4 * 1024 * 1024;
2930
const HASHING_AT_ONCE = 4;
3031

32+
/** Test a child of a directory so a file-only rule does not prune a folder of the same name.
33+
* @param {string} rel @param {boolean} directory */
34+
function isPrivateEntry(rel, directory) {
35+
return isPrivateSourcePath(directory ? `${rel}/x` : rel);
36+
}
37+
3138
/** @param {string} root @param {string} rel @param {import("node:fs").Dirent} entry @param {Walk} walk
3239
* @param {string[]} dirs */
3340
async function visit(root, rel, entry, walk, dirs) {
41+
if (isPrivateEntry(rel, entry.isDirectory())) return;
3442
if (entry.isDirectory()) {
3543
if (!excludedFolder(rel)) dirs.push(rel);
3644
return;

0 commit comments

Comments
 (0)