Skip to content

fix(gitignore): anchor runtime output paths so video/export source is tracked - #4

Open
paopaonyapi-creator wants to merge 1 commit into
devfrom
fix/gitignore-anchored-export-path
Open

paopaonyapi-creator wants to merge 1 commit into
devfrom
fix/gitignore-anchored-export-path

Conversation

@paopaonyapi-creator

Copy link
Copy Markdown
Owner

Closes #3

Summary

  • Fixes [Bug] Unanchored export/ in .gitignore hides src/agent-os/video/export from git, so typecheck fails on every CI run #3. export/ in .gitignore was written for one root-level runtime output directory —
    export-package-builder.ts defaults its output to join(process.cwd(), "export", jobId) — but an
    unanchored pattern matches at every depth, so it also covered src/agent-os/video/export/ and
    kept a real source file out of the index for its entire existence.
  • Two tracked modules import that file (src/agent-os/video/index.ts:23,
    src/agent-os/video/mcp-tools.ts:8), so every fresh clone failed bun run typecheck with
    three TS2307/TS2305 errors. That reddened the gates job, and gates feeds the ci
    aggregate, which is why Cross-platform CI has failed on this repository on every branch since
    2026-09-09 — including pull requests that touch nothing related.
  • This commit anchors /data/, /export/ and /scratch/, and adds the previously untracked
    src/agent-os/video/export/export-package-builder.ts (260 lines, unchanged content — it is being
    committed as written, now that git can see it).
  • go/ is deliberately left unanchored. Its breadth is intentional: the comment block above it
    records that go/internal/cli/config_parity.go was swept into the index by a broad git add
    three times and reached dev once, and tests/repo-hygiene.test.ts guards it. Narrowing that
    pattern would reopen a documented recurring accident.
  • Adds the class-level regression test rather than only fixing this instance: every relative runtime
    import of a tracked src/ module must resolve to a tracked file.

Verification

RED   bun test tests/repo-hygiene.test.ts   -> 1250 pass / 2 fail
      failing cases were exactly:
        src/agent-os/video/index.ts      -> "./export/export-package-builder"
        src/agent-os/video/mcp-tools.ts  -> "./export/export-package-builder"
GREEN bun test tests/repo-hygiene.test.ts   -> 1253 pass / 0 fail / 1264 expect()  [2.57s]
      (case count rises by one because the newly tracked file is now itself scanned)

bun run typecheck    -> clean
bun run privacy:scan -> clean

The test asserts against the git index (git ls-files), not the filesystem, which is the only way
this failure is visible at all: the developer's disk and the repository disagree here, and an
existence check cannot tell them apart. It reuses the existing trackedFiles() helper and the
runtime-import matcher shape from tests/core-lab-boundary.test.ts, including dynamic import().

Scope was measured before anchoring, not assumed. Of 72 ignored paths sitting in nested
data//export//scratch/ directories, exactly one was owned solely by a bare pattern — the
source file above. The rest are held by independent rules (docs-site/.gitignore:6:node_modules/,
.gitignore:2:dist/), so anchoring frees nothing unintended. Verified after the change:
/data/, /export/, /scratch/ still ignore root-level runtime output, and go/ still matches at
every depth.

Not fixed here, stated so it is not mistaken for scope creep or for silent acceptance: the
remaining baseline failures — test 1/4–test 4/4 (a Windows process-spawn group: ocx restart,
ocx status --json, journal ownership), npm-global on all three OS at the "downloads bundled
bun" step, storage policy and api usage — are separate defects with separate causes. This PR
clears gates/ci-aggregate causality only. On a local full run bun run test still exceeded its
own 900s budget on this machine, so repository CI is the authoritative signal for the shards.

One follow-up observation now that the file is reviewable: buildPackage accepts a caller-supplied
options.destinationDir and writes eight files into it without constraining it to a workspace root
(export-package-builder.ts:165). Its callers are management-API routes, so this is not reachable
anonymously, and I have left the behaviour unchanged rather than widen this fix.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

… tracked

`export/` was written for one root-level directory -- export-package-builder defaults
its output to join(process.cwd(), "export", jobId) -- but an unanchored pattern matches
at every depth, so it also covered src/agent-os/video/export/ and kept a real source
file out of the index. Two tracked modules import that file, so every fresh clone
failed `bun run typecheck` with TS2307, which reddened the gates job and therefore the
ci aggregate on every branch since 2026-09-09. It stayed invisible because the file
compiles on the machine that wrote it and `git add` on an ignored path is a silent
no-op unless forced.

Anchor /data/, /export/ and /scratch/. Leave go/ unanchored: that tree is retired at
every depth and its pattern is deliberately broad, with its own repo-hygiene guard.

Add the regression test so the class is caught, not just this instance: every relative
runtime import of a tracked src/ module must resolve to a tracked file. It asserts
against the git index rather than the filesystem, which is the only way to see this
failure at all -- the developer disk and the repository disagree here, and existence
checks cannot tell them apart. Verified red on the two importing modules before the fix,
green after.
@github-actions

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 23, 2026
@paopaonyapi-creator

Copy link
Copy Markdown
Owner Author

Correction to the Verification section above. It says this PR "clears gates/ci-aggregate
causality". CI disproves that, and the claim should not stand uncorrected.

gates runs several steps in order and aborts at the first failure, so the typecheck error was
hiding the next one. On run 35826365916 for 2c4285a0e:

Checkout => success
Install dependencies => success
Typecheck => success      <-- was failure on every run since 2026-09-09; this PR fixes it
GUI tests => failure      <-- previously never reached, so never visible
Privacy scan => skipped

So the fix does what it claims for its own scope — Typecheck is green in CI with the previously
untracked export-package-builder.ts present — but gates and therefore ci are still red, one
layer down.

The next layer is unrelated to this PR: cd gui && bun test --isolate tests fails on i18n drift,
and it is deterministic, not a runner artifact. Locally: 1123 pass / 5 fail, and the CI log for
this run lists the identical five:

(fail) locale key sets stay identical to the English source
(fail) every locale key set matches the English source
(fail) French base catalog > does not ship accidental English values
(fail) zh-TW ships no untranslated English placeholders beyond the intentional allowlist
(fail) every row maps one-to-one onto a page

Nothing in this PR touches i18n or the dashboard, so I am leaving it out of scope rather than
expanding the diff. Filing it separately.

paopaonyapi-creator pushed a commit that referenced this pull request Sep 23, 2026
…ied launch plan

Add FlociAwsAdapter and the launch-plan layer that configures it, against the upstream
configuration reference rather than LocalStack habits. The decisive fact is that FLOCI_PORT
exists, which is what makes one emulator instance per sandbox possible and therefore makes
the isolation guarantee in section 11.2 real instead of aspirational.

Pin by digest, not tag: the published channel is only latest and dated nightlies with no
stable semver, so the section 66 rule can only be satisfied immutably. Record that, the Java
and Vert.x runtime, the absence of npm and PyPI packages, and the per-service image
variables, in docs section 10.2 -- those variables are also the answer to the section 74
question about where the image allowlist lives.

Two refusals that matter more than the features:

- listResources throws RESOURCE_DISCOVERY_FAILED instead of returning an empty list. An
  empty list would tell the observatory, the diff engine and the promotion gate that the
  sandbox holds nothing, and a "no leaks" verdict built on that is worse than no verdict.
  Inventory comes from Terraform state in M3, and upstream documents no resource-listing
  endpoint or core health route.
- The launch plan has no path to process.env and emits no AWS_ variables. Upstream's own
  quickstart is `eval $(floci env)`, which would put fake credentials and a local endpoint
  into every later process; configuring the emulator and configuring a client of it are
  kept as separate surfaces for exactly that reason.

Also corrects three fidelity markers against upstream's own service table -- EventBridge
and API Gateway REST are in-process, so the old PARTIAL would have forced a section 43
production retest the emulator does not need. Step Functions stays PARTIAL because
upstream says nothing about it, and a guessed fidelity is precisely what section 42 forbids.

Verified: 175 pass / 0 fail across the subsystem, policy and hygiene sets; typecheck reports
zero errors from src/agent-os/cloud-sandbox (the three remaining TS errors are issue #3,
removed by PR #4); privacy:scan clean.
paopaonyapi-creator pushed a commit that referenced this pull request Sep 23, 2026
…ied launch plan

Add FlociAwsAdapter and the launch-plan layer that configures it, against the upstream
configuration reference rather than LocalStack habits. The decisive fact is that FLOCI_PORT
exists, which is what makes one emulator instance per sandbox possible and therefore makes
the isolation guarantee in section 11.2 real instead of aspirational.

Pin by digest, not tag: the published channel is only latest and dated nightlies with no
stable semver, so the section 66 rule can only be satisfied immutably. Record that, the Java
and Vert.x runtime, the absence of npm and PyPI packages, and the per-service image
variables, in docs section 10.2 -- those variables are also the answer to the section 74
question about where the image allowlist lives.

Two refusals that matter more than the features:

- listResources throws RESOURCE_DISCOVERY_FAILED instead of returning an empty list. An
  empty list would tell the observatory, the diff engine and the promotion gate that the
  sandbox holds nothing, and a "no leaks" verdict built on that is worse than no verdict.
  Inventory comes from Terraform state in M3, and upstream documents no resource-listing
  endpoint or core health route.
- The launch plan has no path to process.env and emits no AWS_ variables. Upstream's own
  quickstart is `eval $(floci env)`, which would put fake credentials and a local endpoint
  into every later process; configuring the emulator and configuring a client of it are
  kept as separate surfaces for exactly that reason.

Also corrects three fidelity markers against upstream's own service table -- EventBridge
and API Gateway REST are in-process, so the old PARTIAL would have forced a section 43
production retest the emulator does not need. Step Functions stays PARTIAL because
upstream says nothing about it, and a guessed fidelity is precisely what section 42 forbids.

Verified: 175 pass / 0 fail across the subsystem, policy and hygiene sets; typecheck reports
zero errors from src/agent-os/cloud-sandbox (the three remaining TS errors are issue #3,
removed by PR #4); privacy:scan clean.
@paopaonyapi-creator

Copy link
Copy Markdown
Owner Author

Reviewer note: this PR cannot turn its own gates job green, and that is not a defect in it.

gates runs several steps and aborts at the first failure. Before this PR the first failure was
Typecheck; this PR fixes that, which exposed the step behind it, GUI tests, which fails on five
pre-existing i18n/sidebar assertions tracked in #5.

So gates => ci will stay red here until #5 is addressed. Judging this PR on its own scope:

  • Typecheck => success on this branch, and three TS2307/TS2305 errors that were present on
    every branch since 2026-09-09 are gone.
  • The regression test is non-vacuous by construction: it fails if any tracked module's relative
    import stops resolving to tracked content, which is exactly the condition this PR removes.
  • GitHub rejects self-approval on this PR (Review Can not approve your own pull request), so a
    second pair of eyes is structurally required, not optional.

#2 is currently stacked on this branch, so this PR merging first is also what unblocks that base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant