Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

The Slice Contract Compiled Before Any Remote Token Moved

说明与用途

在此示例中,开发人员使用 JSON 合同和本地打包脚本来限制远程编码模型对仓库的访问,防止秘密泄露,并安全地运行失败的测试。

问题

A failing integration test in a monorepo required a remote coding model to run, but the model could not see the repository tree until a local contract was compiled, risking exposure of secrets and large context leaks.

结果

The team successfully isolated the test environment, preventing secret leakage and ensuring the remote model only processed a small, vetted bundle, allowing the failing test to pass locally before remote execution.

工作流

  • 1. Define a slice-contract.json with ticket, failing_command, done_when, allow, deny_globs, redact, max_bytes.
  • 2. Run a local packer script (scripts/pack-slice.mjs) to copy only allowed files, apply deny globs, redact secrets, and enforce size limit.
  • 3. Verify the packed bundle meets constraints and does not exceed max_bytes.
  • 4. Provide the bundle to the remote coding model for execution.
  • 5. Confirm the failing_command exits 0 and git diff --stat stays within allowed files.

证据

The senior did not take the keyboard to generate a prompt. They created slice-contract.json in the repo root and waited.

来源

The script reads the contract, copies only allowlisted files, applies deny globs, redacts line-level matches, and refuses to emit a bundle over max_bytes.

来源

  • 记录日期: 2026-09-19T06:30:37.637Z