@elvis1513/auto-coding-skill 4.3.2 → 4.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/cli/assets/managed-install.json +1 -1
- package/cli/assets/skill/data/policies/feedback-resolutions-v1.json +48 -0
- package/cli/assets/skill/data/policies/workflow-migrations-v1.json +2 -2
- package/cli/assets/skill/data/templates/ENGINEERING.md +2 -2
- package/cli/assets/skill/data/templates/bridges/AGENTS.md +1 -1
- package/cli/assets/skill/scripts/ap.py +107 -17
- package/cli/src/index.js +0 -12
- package/cli/tests/ap_concurrency_test.py +91 -7
- package/cli/tests/ap_profiles_test.py +108 -2
- package/cli/tests/core_shell_test.py +5 -5
- package/cli/tests/index.test.js +37 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,11 @@ The Skill is a selectable guardrail, not a command sequence that must run for
|
|
|
9
9
|
every task. The model skips machinery whose expected benefit does not exceed its
|
|
10
10
|
cost; read-only work and obvious small clean-checkout changes normally stay direct.
|
|
11
11
|
|
|
12
|
-
Version 4.3.
|
|
12
|
+
Version 4.3.3 resolves the first multi-project feedback batch: read-only
|
|
13
|
+
Reviewer artifact access is mutation-free, substantive nonzero-exit results are
|
|
14
|
+
preserved, lifecycle identities fail early, managed protocol classification and
|
|
15
|
+
database migration signals are precise, and empty feedback status reports the
|
|
16
|
+
installed version. Version 4.3.2 keeps upgrade history outside active `docs/`, so an upgrade that
|
|
13
17
|
archives the previous managed AGENTS or ENGINEERING contract is immediately
|
|
14
18
|
idempotent and `status` remains current. Version 4.3.1 preserves recursively nested project documentation assets of any
|
|
15
19
|
file type, and gives project-owned Skill feedback a release-aware lifecycle with
|
|
@@ -388,6 +392,26 @@ model overrides, complete project `risk.rules`, supported project/access/
|
|
|
388
392
|
concurrency/route/structure values, and an existing project-owned structure
|
|
389
393
|
standard byte-for-byte. Removed content is archived outside active docs.
|
|
390
394
|
|
|
395
|
+
## What changed in 4.3.3
|
|
396
|
+
|
|
397
|
+
- Made existing Git-local Reviewer storage validation read-only: the writable
|
|
398
|
+
supervisor establishes mode `0700`, while the Reviewer verifies ownership and
|
|
399
|
+
mode without calling `chmod` from its read-only sandbox. Reviewer artifact and
|
|
400
|
+
result-template commands now use the exact absolute runtime that launched
|
|
401
|
+
`review-run`, allowing a fixed runtime to review a task created by an older
|
|
402
|
+
project installation without changing that task's base or owned scope.
|
|
403
|
+
- Preserved contract-valid `blocked` and `changes-requested` results when the
|
|
404
|
+
Reviewer process exits nonzero, while retaining the blocking runtime receipt.
|
|
405
|
+
- Rejected `task-start` owner/writer values that conflict with
|
|
406
|
+
`CODEX_THREAD_ID` before creating task state or worktrees.
|
|
407
|
+
- Classified root `AGENTS.md` as managed release/tooling authority and prevented
|
|
408
|
+
unqualified workflow/configuration migration wording or policy filenames from
|
|
409
|
+
being mislabeled as database changes.
|
|
410
|
+
- Reported the installed Skill version in status even before a project creates
|
|
411
|
+
its first feedback report.
|
|
412
|
+
- Added release-catalog resolutions for all nine reports collected from the
|
|
413
|
+
seven-project 4.3.2 rollout, including canonical duplicate mappings.
|
|
414
|
+
|
|
391
415
|
## What changed in 4.3.2
|
|
392
416
|
|
|
393
417
|
- Moved managed AGENTS and duplicate-workflow ENGINEERING history into
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schema_version":1,"skill_version":"4.3.
|
|
1
|
+
{"schema_version":1,"skill_version":"4.3.3","manifest_path":".agents/managed-install.json","entries":[{"path":".agents/agents/browser-debugger.toml","source":"agents/browser-debugger.toml","ownership":"normalized-agent","sha256":"40727952944917eb0b573bb96dca2906c27bc794737f3b6b392b56df7b4208aa","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/agents/docs-researcher.toml","source":"agents/docs-researcher.toml","ownership":"normalized-agent","sha256":"aa1fed6a6a1cde282fc152c7a88b8e097a6c53bcf447d35978607d594e3cb3e4","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/agents/explorer.toml","source":"agents/explorer.toml","ownership":"normalized-agent","sha256":"4cd89888acf7c0c04fbbcd0b9a0f346c6efed42fb723ec2037af9331a84a1cac","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/agents/fixer.toml","source":"agents/fixer.toml","ownership":"normalized-agent","sha256":"7bc00a45b9d1bcc90b8b0f06d773556eba1d52effff664472c3cb81073f6abfb","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/agents/reviewer.toml","source":"agents/reviewer.toml","ownership":"normalized-agent","sha256":"e1ad676e608ffee04d782571fb9bfbc787f69c100941b1811d955ef80439db36","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/SKILL.md","source":"skill/SKILL.md","ownership":"exact","sha256":"d142951aa5cd7062ec467421654c7cda0a9dac2262eedc97a92590428b3a21e7","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/data/contracts/orchestration-v1.schema.json","source":"skill/data/contracts/orchestration-v1.schema.json","ownership":"exact","sha256":"65a8c0d222b26f224794ec106101f903f0e3a357b249c2df22c5908a476a6835","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/data/policies/feedback-resolutions-v1.json","source":"skill/data/policies/feedback-resolutions-v1.json","ownership":"exact","sha256":"6305c1ea8d1f4f137e606bb0277e041d6ad6792dc63be6eba642df7269d75bf7","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/data/policies/workflow-migrations-v1.json","source":"skill/data/policies/workflow-migrations-v1.json","ownership":"exact","sha256":"b190a2073eb36795e4d4778b6bb629c66f9856c6a1ab08c961d89c54e20ba8d3","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/data/templates/ENGINEERING.md","source":"skill/data/templates/ENGINEERING.md","ownership":"exact","sha256":"c00be2791ad9916fcc11227e2c377d4c2ffe7cc65e607796d8778bce1206780a","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/data/templates/bridges/AGENTS.md","source":"skill/data/templates/bridges/AGENTS.md","ownership":"exact","sha256":"311ebbf9846e84aa1e2bfa08137878ebb14b9182081dd0d7d281e252ed396eb1","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/data/templates/tools/ap.py","source":"skill/data/templates/tools/ap.py","ownership":"exact","sha256":"c352fbf2cbcb9692a34fd952d8541b1cbe6d475c6e11e64500a1f6b5283a00be","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/requirements.txt","source":"skill/requirements.txt","ownership":"exact","sha256":"0969da99a0bc2a1b71ed50584560f4588a37567ac63af3ddbaf3c4617ca5621a","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/scripts/ap.py","source":"skill/scripts/ap.py","ownership":"exact","sha256":"92895334da60133afdd82dc44ea72c9a013131f423b5963ff86f6377356911af","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/scripts/core.py","source":"skill/scripts/core.py","ownership":"exact","sha256":"caefca925929bad840c3471b86332d4be48b5e19ad0ff79fde1dcedef0297c16","executable":true,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/scripts/http_checks.py","source":"skill/scripts/http_checks.py","ownership":"exact","sha256":"5620e187a0129f135621425a84b3a4e8f31137263c7e549a36a801fc36ff54ea","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/scripts/install_integrity.py","source":"skill/scripts/install_integrity.py","ownership":"exact","sha256":"41a2df7935027fb43cfcb3d18e57a7f33adc4861420ff43c8828743ad71cc429","executable":false,"scope":"shared","version":"4.3.3"},{"path":".agents/skills/auto-coding-skill/scripts/scaffold_templates.py","source":"skill/scripts/scaffold_templates.py","ownership":"exact","sha256":"7f25761cc065bb8c2875c8c99bea9077d339dedae81aeeddfab1c35f4cf054b3","executable":false,"scope":"shared","version":"4.3.3"},{"path":"AGENTS.md","source":"skill/data/templates/bridges/AGENTS.md","ownership":"exact","sha256":"311ebbf9846e84aa1e2bfa08137878ebb14b9182081dd0d7d281e252ed396eb1","executable":false,"scope":"project","version":"4.3.3"},{"path":"docs/ENGINEERING.md","source":"skill/data/templates/ENGINEERING.md","ownership":"exact","sha256":"c00be2791ad9916fcc11227e2c377d4c2ffe7cc65e607796d8778bce1206780a","executable":false,"scope":"project","version":"4.3.3"},{"path":"docs/architecture/adr/_TEMPLATE-ADR.md","source":"generated:scaffold_templates:docs/architecture/adr/_TEMPLATE-ADR.md","ownership":"exact","sha256":"88c89065ae0f8555412dbe096c05342152efc7becae8d8981e6442cdfee8e672","executable":false,"scope":"project","version":"4.3.3"},{"path":"docs/deployment/deploy-records/_TEMPLATE-DEPLOY-RECORD.md","source":"generated:scaffold_templates:docs/deployment/deploy-records/_TEMPLATE-DEPLOY-RECORD.md","ownership":"exact","sha256":"f2c17c0febc322b0ad50fb9d6f7e64e6c0cfb15c8a3e445a99da40f0a0dd1901","executable":false,"scope":"project","version":"4.3.3"},{"path":"docs/design/_TEMPLATE-DD.md","source":"generated:scaffold_templates:docs/design/_TEMPLATE-DD.md","ownership":"exact","sha256":"6ca022d127bfff68521f466b60bace4f1206baf0913daa855b9f751e74198db3","executable":false,"scope":"project","version":"4.3.3"},{"path":"docs/reviews/_TEMPLATE-REVIEW.md","source":"generated:scaffold_templates:docs/reviews/_TEMPLATE-REVIEW.md","ownership":"exact","sha256":"134f0d1bd3c7a317ef3cf4c2aea9f0539f3d53dccd5bcdabf6915b3629ef8802","executable":false,"scope":"project","version":"4.3.3"},{"path":"docs/skill-feedback/README.md","source":"generated:scaffold_templates:docs/skill-feedback/README.md","ownership":"exact","sha256":"3b146e1b7e7a1d4af57635307b825b38ce7bc58d1ee5f98871c877a64936edab","executable":false,"scope":"project","version":"4.3.3"},{"path":"docs/skill-feedback/_TEMPLATE-SKILL-FEEDBACK.md","source":"generated:scaffold_templates:docs/skill-feedback/_TEMPLATE-SKILL-FEEDBACK.md","ownership":"exact","sha256":"90ff26074305f8da537892060ffbc3a0206841702ed0483545e4ebe84e3ff357","executable":false,"scope":"project","version":"4.3.3"},{"path":"docs/tools/autopipeline/ap.py","source":"skill/data/templates/tools/ap.py","ownership":"exact","sha256":"c352fbf2cbcb9692a34fd952d8541b1cbe6d475c6e11e64500a1f6b5283a00be","executable":false,"scope":"project","version":"4.3.3"}],"managed_namespaces":[{"path":".agents/skills/auto-coding-skill","scope":"shared"},{"path":"docs/tools/autopipeline","scope":"project"}],"preserved":[".agents/archive/**",".agents/agents/* (except paths listed in entries)","docs/project/auto-coding-skill.yaml","docs/architecture/structure-standard.md","docs/architecture/** (except exact-managed entries)","docs/bugs/** (except exact-managed entries)","docs/deployment/** (except exact-managed entries)","docs/design/** (except exact-managed entries)","docs/interfaces/** (except exact-managed entries)","docs/project/** (except exact-managed entries)","docs/reviews/** (except exact-managed entries)","docs/testing/** (except exact-managed entries)","docs/skill-feedback/reports/*.md"]}
|
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "auto-coding-skill-feedback-resolutions/v1",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"signature": "sha256:1295e7d7d67b4f3c634737d078ddbf4846898c4118dfa92aa83d4a99049dd377",
|
|
6
|
+
"disposition": "fixed",
|
|
7
|
+
"effective_skill_version": "4.3.3"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"signature": "sha256:2099575c9af1d8e58aa4beb45f4bb42321347ef995746f785f27fd56d3a2949e",
|
|
11
|
+
"disposition": "fixed",
|
|
12
|
+
"effective_skill_version": "4.3.3"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"signature": "sha256:2b2de99b5d13ed5be4ff4733e177bd5e03ba3f1e93e97aa98a518eed57d011c7",
|
|
16
|
+
"disposition": "fixed",
|
|
17
|
+
"effective_skill_version": "4.3.3"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"signature": "sha256:310632d2756bf2da1894bb9841463964924d02ab6e436883ccce11d58b8f36eb",
|
|
21
|
+
"disposition": "fixed",
|
|
22
|
+
"effective_skill_version": "4.3.3"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"signature": "sha256:5f712ecb25ae589702e3740a21edd439b2879bdf59542cf475ad494d35f2149c",
|
|
26
|
+
"disposition": "duplicate",
|
|
27
|
+
"effective_skill_version": "4.3.3",
|
|
28
|
+
"canonical_signature": "sha256:310632d2756bf2da1894bb9841463964924d02ab6e436883ccce11d58b8f36eb"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"signature": "sha256:682b73e95a0394a548d4ec8f71290c4013c9ff09dc86d1944ece16544cb3ac49",
|
|
32
|
+
"disposition": "fixed",
|
|
33
|
+
"effective_skill_version": "4.3.3"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"signature": "sha256:6970f6b2ddbcade14d0bfcd767590ceb5a4249cfa7967bb6f1a5aaa3f1631ecd",
|
|
37
|
+
"disposition": "duplicate",
|
|
38
|
+
"effective_skill_version": "4.3.3",
|
|
39
|
+
"canonical_signature": "sha256:682b73e95a0394a548d4ec8f71290c4013c9ff09dc86d1944ece16544cb3ac49"
|
|
40
|
+
},
|
|
4
41
|
{
|
|
5
42
|
"signature": "sha256:73270c5822d44e9b2e8ff33ab06808496557d78a1a9adc3fa66b8389f23dcb96",
|
|
6
43
|
"disposition": "fixed",
|
|
@@ -11,6 +48,17 @@
|
|
|
11
48
|
"disposition": "project-config",
|
|
12
49
|
"effective_skill_version": "4.3.1"
|
|
13
50
|
},
|
|
51
|
+
{
|
|
52
|
+
"signature": "sha256:acab2e53a30772d2c98a9b22febf5b6adfee898f77530343745f2dbdde72325a",
|
|
53
|
+
"disposition": "fixed",
|
|
54
|
+
"effective_skill_version": "4.3.3"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"signature": "sha256:f822eb5ab8906dcf3c7f39049bc5aad8632524bb33ca166b6f00173dce8f9f4b",
|
|
58
|
+
"disposition": "duplicate",
|
|
59
|
+
"effective_skill_version": "4.3.3",
|
|
60
|
+
"canonical_signature": "sha256:310632d2756bf2da1894bb9841463964924d02ab6e436883ccce11d58b8f36eb"
|
|
61
|
+
},
|
|
14
62
|
{
|
|
15
63
|
"signature": "sha256:fd5748e4ae40e9f86762c4f62b3302bbbb2b8ae9661adf9e0e07a2327ccf7a36",
|
|
16
64
|
"disposition": "fixed",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
workflow:
|
|
3
|
-
skill_version: "4.3.
|
|
3
|
+
skill_version: "4.3.3"
|
|
4
4
|
mode: "dev"
|
|
5
5
|
profile: "auto"
|
|
6
6
|
completion: "push"
|
|
@@ -83,7 +83,7 @@ docs:
|
|
|
83
83
|
api_change_log: "docs/interfaces/api-change-log.md"
|
|
84
84
|
---
|
|
85
85
|
# Engineering Configuration and Project Facts
|
|
86
|
-
<!-- auto-coding-skill:managed-workflow:start version=4.3.
|
|
86
|
+
<!-- auto-coding-skill:managed-workflow:start version=4.3.3 -->
|
|
87
87
|
Root `AGENTS.md` is the single shared behavioral protocol. The installed
|
|
88
88
|
`SKILL.md` contains invocation guidance. This whole file is the managed default
|
|
89
89
|
configuration contract. Project-owned values live only in
|
|
@@ -287,7 +287,7 @@ _FINAL_GATE_CACHE_ALGORITHM = "final-gate-v1"
|
|
|
287
287
|
_WORKFLOW_MIGRATION_POLICY = Path("data/policies/workflow-migrations-v1.json")
|
|
288
288
|
_FALLBACK_WORKFLOW_MIGRATION_POLICY = {
|
|
289
289
|
"schema_version": 1,
|
|
290
|
-
"managed_versions": {"agents": "4.3.
|
|
290
|
+
"managed_versions": {"agents": "4.3.3", "engineering": "4.3.3"},
|
|
291
291
|
"known_official_engineering_body_sha256": [
|
|
292
292
|
"d1306cc626e8baf8c83c953b760fd771066de2bf125168eca3a7b7d6ff2b87a2",
|
|
293
293
|
"305931c6edef770033a4f1970b00e5fb1c1728351856a173dbfa497daf563021",
|
|
@@ -4895,9 +4895,19 @@ def _guard_review_directory(path: Path, common_dir: Path, *, create: bool) -> No
|
|
|
4895
4895
|
raise APError(f"Git-local review storage escapes the Git common directory: {path}") from exc
|
|
4896
4896
|
if os.name == "posix" and path.exists():
|
|
4897
4897
|
try:
|
|
4898
|
-
path.
|
|
4898
|
+
metadata = path.lstat()
|
|
4899
|
+
if metadata.st_uid != os.geteuid():
|
|
4900
|
+
raise APError(f"Git-local review storage must be owned by the current user: {path}")
|
|
4901
|
+
if create:
|
|
4902
|
+
path.chmod(0o700)
|
|
4903
|
+
metadata = path.lstat()
|
|
4904
|
+
if stat.S_IMODE(metadata.st_mode) != 0o700:
|
|
4905
|
+
raise APError(f"Git-local review storage must use mode 0700: {path}")
|
|
4906
|
+
except APError:
|
|
4907
|
+
raise
|
|
4899
4908
|
except OSError as exc:
|
|
4900
|
-
|
|
4909
|
+
action = "protect" if create else "verify"
|
|
4910
|
+
raise APError(f"Cannot {action} Git-local review storage: {path}: {exc}") from exc
|
|
4901
4911
|
|
|
4902
4912
|
|
|
4903
4913
|
def _task_review_root(repo: Path, *, create: bool = False) -> Path:
|
|
@@ -5985,8 +5995,12 @@ def _require_task_context(repo: Path, cfg: dict, task_id: str) -> dict:
|
|
|
5985
5995
|
@contextlib.contextmanager
|
|
5986
5996
|
def _repo_lock(repo: Path, name: str, timeout_s: float = 30.0) -> Iterator[None]:
|
|
5987
5997
|
safe_name = re.sub(r"[^A-Za-z0-9._-]+", "-", name).strip("-") or "repository"
|
|
5988
|
-
|
|
5989
|
-
|
|
5998
|
+
common_dir = _git_common_dir(repo).resolve()
|
|
5999
|
+
state_root = common_dir / "auto-coding-skill"
|
|
6000
|
+
lock_root = state_root / "locks"
|
|
6001
|
+
_guard_review_directory(state_root, common_dir, create=True)
|
|
6002
|
+
_guard_review_directory(lock_root, common_dir, create=True)
|
|
6003
|
+
lock_path = lock_root / f"{safe_name}.lock"
|
|
5990
6004
|
handle = lock_path.open("a+", encoding="utf-8")
|
|
5991
6005
|
try:
|
|
5992
6006
|
try:
|
|
@@ -6153,6 +6167,7 @@ _SCOPE_RANK = {"changed": 0, "standard": 1, "full": 2}
|
|
|
6153
6167
|
_DOC_PATH_PATTERNS = ["*.md", "docs/**"]
|
|
6154
6168
|
_DEFAULT_FULL_PATH_PATTERNS = [
|
|
6155
6169
|
".agents/**",
|
|
6170
|
+
"AGENTS.md",
|
|
6156
6171
|
".github/workflows/**",
|
|
6157
6172
|
"Jenkinsfile",
|
|
6158
6173
|
"Jenkinsfile.*",
|
|
@@ -9047,7 +9062,24 @@ def _classify_paths(paths: list[str]) -> dict:
|
|
|
9047
9062
|
words = {word for word in re.split(r"[^a-z0-9]+", lower) if word}
|
|
9048
9063
|
if _path_matches(path, _DEFAULT_FULL_PATH_PATTERNS):
|
|
9049
9064
|
categories.add("release_or_tooling")
|
|
9050
|
-
|
|
9065
|
+
parts = [part for part in lower.replace("\\", "/").strip("/").split("/") if part]
|
|
9066
|
+
directories = set(parts[:-1])
|
|
9067
|
+
suffix = Path(lower).suffix
|
|
9068
|
+
semantic_path_words = words
|
|
9069
|
+
project_documentation_or_managed_skill = bool(directories & {".agents", "docs"})
|
|
9070
|
+
if (
|
|
9071
|
+
suffix in {".ddl", ".sql"}
|
|
9072
|
+
or directories & {"alembic", "flyway", "liquibase", "prisma"}
|
|
9073
|
+
or (
|
|
9074
|
+
semantic_path_words & {"database", "databases", "db", "schema", "schemas", "sql"}
|
|
9075
|
+
and not project_documentation_or_managed_skill
|
|
9076
|
+
)
|
|
9077
|
+
or (
|
|
9078
|
+
semantic_path_words & {"migration", "migrations"}
|
|
9079
|
+
and not project_documentation_or_managed_skill
|
|
9080
|
+
and "workflow" not in semantic_path_words
|
|
9081
|
+
)
|
|
9082
|
+
):
|
|
9051
9083
|
categories.add("db")
|
|
9052
9084
|
if any(token in lower for token in ["api", "controller", "handler", "route", "server"]):
|
|
9053
9085
|
categories.add("api")
|
|
@@ -9111,7 +9143,10 @@ def _classification_for_categories(categories: set[str], file_count: int) -> dic
|
|
|
9111
9143
|
def _classify_intent(intent: str) -> list[str]:
|
|
9112
9144
|
value = _text(intent).lower()
|
|
9113
9145
|
keyword_categories = {
|
|
9114
|
-
"db": [
|
|
9146
|
+
"db": [
|
|
9147
|
+
"database", "db migration", "data migration", "database migration",
|
|
9148
|
+
"database schema", "table schema", "sql", "数据库", "数据迁移", "表结构",
|
|
9149
|
+
],
|
|
9115
9150
|
"api": ["api", "controller", "endpoint", "接口", "控制器"],
|
|
9116
9151
|
"auth": ["auth", "permission", "security", "登录", "认证", "鉴权", "权限", "安全"],
|
|
9117
9152
|
"payment": ["payment", "billing", "checkout", "支付", "账单", "结算"],
|
|
@@ -9135,7 +9170,8 @@ def _high_confidence_intent_categories(intent: str) -> set[str]:
|
|
|
9135
9170
|
value = _text(intent).lower()
|
|
9136
9171
|
signals = {
|
|
9137
9172
|
"db": [
|
|
9138
|
-
"
|
|
9173
|
+
"database", "db migration", "data migration", "database migration",
|
|
9174
|
+
"database schema", "table schema", "ddl", "sql", "table structure",
|
|
9139
9175
|
"数据迁移", "数据库迁移", "表结构", "数据库结构",
|
|
9140
9176
|
],
|
|
9141
9177
|
"auth": [
|
|
@@ -9755,23 +9791,34 @@ def _codex_reviewer_command(
|
|
|
9755
9791
|
if depth not in {"focused", "deep"}:
|
|
9756
9792
|
raise APError(f"Unsupported Reviewer depth: {review_depth!r}")
|
|
9757
9793
|
reasoning_effort = "high" if depth == "focused" else "xhigh"
|
|
9794
|
+
runtime_python = os.path.abspath(sys.executable)
|
|
9795
|
+
runtime_script = Path(__file__).resolve()
|
|
9758
9796
|
artifact_command = shlex.join(
|
|
9759
9797
|
[
|
|
9760
|
-
|
|
9761
|
-
|
|
9798
|
+
runtime_python,
|
|
9799
|
+
str(runtime_script),
|
|
9762
9800
|
"review-artifact",
|
|
9763
9801
|
"--file",
|
|
9764
9802
|
str(assignment_path),
|
|
9765
9803
|
]
|
|
9766
9804
|
)
|
|
9805
|
+
template_command = shlex.join(
|
|
9806
|
+
[
|
|
9807
|
+
runtime_python,
|
|
9808
|
+
str(runtime_script),
|
|
9809
|
+
"agent-result-template",
|
|
9810
|
+
"--file",
|
|
9811
|
+
str(assignment_path),
|
|
9812
|
+
]
|
|
9813
|
+
)
|
|
9767
9814
|
prompt = (
|
|
9768
9815
|
f"Review the exact assignment at {assignment_path}. "
|
|
9769
9816
|
f"Before analysis, run `{artifact_command}`; it verifies diff_artifact_path, "
|
|
9770
9817
|
"mode 0600, and diff_artifact_sha256, then emits the immutable patch. "
|
|
9771
9818
|
"Review that emitted patch and never substitute a live git diff or diff_base..diff_head. "
|
|
9772
9819
|
"Stay inside its identity and deadline. Use "
|
|
9773
|
-
"`
|
|
9774
|
-
|
|
9820
|
+
f"`{template_command} --verdict approved` when useful, replacing `approved` "
|
|
9821
|
+
"with `changes-requested` or `blocked` when appropriate. "
|
|
9775
9822
|
"Return only one JSON object as the final response; do not modify files."
|
|
9776
9823
|
)
|
|
9777
9824
|
command = [
|
|
@@ -10515,7 +10562,7 @@ def _resolve_execution_plan(
|
|
|
10515
10562
|
detected_profile = "standard"
|
|
10516
10563
|
profile_reasons: list[str] = []
|
|
10517
10564
|
docs_only_paths = _docs_only(classification_inputs)
|
|
10518
|
-
docs_or_tests_only = bool(classification_inputs) and (
|
|
10565
|
+
docs_or_tests_only = "release_or_tooling" not in path_categories and bool(classification_inputs) and (
|
|
10519
10566
|
(docs_only_paths and str(impact["selected_scope"]) != "full")
|
|
10520
10567
|
or _tests_only(classification_inputs)
|
|
10521
10568
|
)
|
|
@@ -12870,6 +12917,11 @@ def cmd_task_start(args: argparse.Namespace) -> None:
|
|
|
12870
12917
|
"only when classify requires isolation/review or the user explicitly requests it."
|
|
12871
12918
|
)
|
|
12872
12919
|
|
|
12920
|
+
owner = _actor_id(args, "owner")
|
|
12921
|
+
runtime_actor = _text(os.environ.get("CODEX_THREAD_ID"))
|
|
12922
|
+
explicit_writer = _text(getattr(args, "writer", ""))
|
|
12923
|
+
writer = _actor_id(args, "writer") if runtime_actor or explicit_writer else owner
|
|
12924
|
+
|
|
12873
12925
|
configured_isolation = _task_isolation(cfg)
|
|
12874
12926
|
access_issues = _access_config_issues(cfg)
|
|
12875
12927
|
if access_issues:
|
|
@@ -12933,10 +12985,6 @@ def cmd_task_start(args: argparse.Namespace) -> None:
|
|
|
12933
12985
|
"prerequisite_shas": prerequisite_shas,
|
|
12934
12986
|
}
|
|
12935
12987
|
_require_dependencies(repo, dependency_contract, base_sha)
|
|
12936
|
-
owner = _text(getattr(args, "owner", "")) or _text(os.environ.get("CODEX_THREAD_ID"))
|
|
12937
|
-
if not owner:
|
|
12938
|
-
raise APError("task-start requires --owner or CODEX_THREAD_ID.")
|
|
12939
|
-
writer = _text(getattr(args, "writer", "")) or owner
|
|
12940
12988
|
plan = _resolve_execution_plan(
|
|
12941
12989
|
cfg,
|
|
12942
12990
|
repo,
|
|
@@ -14655,6 +14703,48 @@ def cmd_review_run(args: argparse.Namespace) -> None:
|
|
|
14655
14703
|
raise APError("Reviewer runtime ended without a process result.")
|
|
14656
14704
|
finished_at = _now_iso()
|
|
14657
14705
|
if completed.returncode != 0:
|
|
14706
|
+
substantive_result = _substantive_reviewer_result(result_path, assignment)
|
|
14707
|
+
if substantive_result is None:
|
|
14708
|
+
try:
|
|
14709
|
+
substantive_result = _substantive_reviewer_event_result(
|
|
14710
|
+
_bounded_reviewer_output(completed.stdout, "stdout"),
|
|
14711
|
+
assignment,
|
|
14712
|
+
)
|
|
14713
|
+
except APError:
|
|
14714
|
+
substantive_result = None
|
|
14715
|
+
if substantive_result is not None:
|
|
14716
|
+
_write_private_json(result_path, substantive_result)
|
|
14717
|
+
result_sha256 = _review_result_file_sha256(result_path)
|
|
14718
|
+
_update_review_runtime(
|
|
14719
|
+
control_repo,
|
|
14720
|
+
task_id,
|
|
14721
|
+
fingerprint,
|
|
14722
|
+
updates={
|
|
14723
|
+
"verdict": substantive_result["verdict"],
|
|
14724
|
+
"reason": "substantive Reviewer result observed before nonzero process exit",
|
|
14725
|
+
"runtime_state": "blocked",
|
|
14726
|
+
"runtime_finished_at": finished_at,
|
|
14727
|
+
"runtime_exit_code": completed.returncode,
|
|
14728
|
+
"runtime_attempt_count": len(attempts),
|
|
14729
|
+
"runtime_failure_kind": "process-exit",
|
|
14730
|
+
},
|
|
14731
|
+
receipt_path=receipt_path,
|
|
14732
|
+
receipt_updates={
|
|
14733
|
+
"status": "blocked",
|
|
14734
|
+
"finished_at": finished_at,
|
|
14735
|
+
"exit_code": completed.returncode,
|
|
14736
|
+
"verdict": substantive_result["verdict"],
|
|
14737
|
+
"attempts": attempts,
|
|
14738
|
+
"failure_kind": "process-exit",
|
|
14739
|
+
"event_log_sha256": event_log_sha256,
|
|
14740
|
+
"result_sha256": result_sha256,
|
|
14741
|
+
},
|
|
14742
|
+
)
|
|
14743
|
+
print(json.dumps(substantive_result, ensure_ascii=False, indent=2))
|
|
14744
|
+
raise APError(
|
|
14745
|
+
"Reviewer produced a substantive result before nonzero process exit; "
|
|
14746
|
+
"it cannot be bypassed."
|
|
14747
|
+
)
|
|
14658
14748
|
result = _blocked_reviewer_runtime_result(
|
|
14659
14749
|
assignment,
|
|
14660
14750
|
"Reviewer runtime exited unsuccessfully.",
|
package/cli/src/index.js
CHANGED
|
@@ -1874,18 +1874,6 @@ function readPackageVersion(){
|
|
|
1874
1874
|
}
|
|
1875
1875
|
|
|
1876
1876
|
function feedbackLifecycleStatus(root, assetSkill){
|
|
1877
|
-
if (!exists(path.join(root, "docs", "skill-feedback", "reports"))) {
|
|
1878
|
-
return {
|
|
1879
|
-
available: true,
|
|
1880
|
-
skillVersion: "",
|
|
1881
|
-
reportCount: 0,
|
|
1882
|
-
activeReportCount: 0,
|
|
1883
|
-
closedReportCount: 0,
|
|
1884
|
-
actionRequiredCount: 0,
|
|
1885
|
-
lifecycleCounts: {},
|
|
1886
|
-
actionRequired: [],
|
|
1887
|
-
};
|
|
1888
|
-
}
|
|
1889
1877
|
const result = spawnSync(
|
|
1890
1878
|
runtimePython(),
|
|
1891
1879
|
[path.join(assetSkill, "scripts", "ap.py"), "feedback-collect", "--project", root, "--json"],
|
|
@@ -332,6 +332,30 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
332
332
|
self.assertIn("AGENTS.md:2", result.stdout + result.stderr)
|
|
333
333
|
self.assert_local_branch(repo, "codex/POLICY-START", False)
|
|
334
334
|
|
|
335
|
+
def test_task_start_rejects_owner_and_writer_that_conflict_with_runtime_identity(self) -> None:
|
|
336
|
+
_, repo, _ = self.make_repo()
|
|
337
|
+
for field in ("owner", "writer"):
|
|
338
|
+
with self.subTest(field=field):
|
|
339
|
+
task_id = f"IDENTITY-{field.upper()}"
|
|
340
|
+
rejected = self.ap(
|
|
341
|
+
repo,
|
|
342
|
+
"task-start",
|
|
343
|
+
task_id,
|
|
344
|
+
"--base",
|
|
345
|
+
"origin/dev",
|
|
346
|
+
"--owned-path",
|
|
347
|
+
"shared.txt",
|
|
348
|
+
"--isolated",
|
|
349
|
+
"--review-required",
|
|
350
|
+
f"--{field}",
|
|
351
|
+
"different-runtime-actor",
|
|
352
|
+
check=False,
|
|
353
|
+
)
|
|
354
|
+
self.assertNotEqual(0, rejected.returncode)
|
|
355
|
+
self.assertIn("does not match CODEX_THREAD_ID", rejected.stdout + rejected.stderr)
|
|
356
|
+
self.assertFalse(self.registry_manifest_path(repo, task_id).exists())
|
|
357
|
+
self.assert_local_branch(repo, f"codex/{task_id}", False)
|
|
358
|
+
|
|
335
359
|
def test_task_start_rejects_legacy_gate_yaml_before_creating_branch(self) -> None:
|
|
336
360
|
_, repo, _ = self.make_repo()
|
|
337
361
|
engineering = repo / "docs" / "ENGINEERING.md"
|
|
@@ -930,13 +954,22 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
930
954
|
"src",
|
|
931
955
|
"--isolated",
|
|
932
956
|
"--review-required",
|
|
933
|
-
"--writer",
|
|
934
|
-
"self-reviewer",
|
|
935
957
|
)
|
|
936
958
|
worktree = self.task_worktree(repo, "SELF-REVIEW")
|
|
937
959
|
payload = worktree / "src" / "payload.txt"
|
|
938
960
|
payload.parent.mkdir(parents=True, exist_ok=True)
|
|
939
961
|
payload.write_text("changed\n", encoding="utf-8")
|
|
962
|
+
self.ap(
|
|
963
|
+
repo,
|
|
964
|
+
"task-handoff",
|
|
965
|
+
"SELF-REVIEW",
|
|
966
|
+
"--from",
|
|
967
|
+
_TEST_OWNER,
|
|
968
|
+
"--to",
|
|
969
|
+
"self-reviewer",
|
|
970
|
+
"--generation",
|
|
971
|
+
"1",
|
|
972
|
+
)
|
|
940
973
|
status = json.loads(
|
|
941
974
|
self.ap(worktree, "task-status", "SELF-REVIEW", "--json").stdout
|
|
942
975
|
)["tasks"][0]
|
|
@@ -1361,6 +1394,47 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
1361
1394
|
self.assertNotEqual(0, bypass.returncode)
|
|
1362
1395
|
self.assertIn("allowed only after", bypass.stdout + bypass.stderr)
|
|
1363
1396
|
|
|
1397
|
+
def test_substantive_result_survives_nonzero_reviewer_exit(self) -> None:
|
|
1398
|
+
root, repo, _ = self.make_repo()
|
|
1399
|
+
worktree = self.start_task(repo, "REVIEW-NONZERO", "shared.txt")
|
|
1400
|
+
(worktree / "shared.txt").write_text("nonzero substantive finding\n", encoding="utf-8")
|
|
1401
|
+
runner_path = root / "nonzero-substantive-reviewer.py"
|
|
1402
|
+
runner_path.write_text(
|
|
1403
|
+
"import json, os\n"
|
|
1404
|
+
"from pathlib import Path\n"
|
|
1405
|
+
"result = Path(os.environ['AUTOCODING_REVIEW_RESULT'])\n"
|
|
1406
|
+
"result.write_text(json.dumps({'verdict': 'changes-requested', 'summary': 'specific defect'}) + '\\n')\n"
|
|
1407
|
+
"result.chmod(0o600)\n"
|
|
1408
|
+
"print(json.dumps({'type': 'turn.started'}), flush=True)\n"
|
|
1409
|
+
"raise SystemExit(7)\n",
|
|
1410
|
+
encoding="utf-8",
|
|
1411
|
+
)
|
|
1412
|
+
rejected = self.ap(
|
|
1413
|
+
worktree,
|
|
1414
|
+
"review-run",
|
|
1415
|
+
"REVIEW-NONZERO",
|
|
1416
|
+
"--reviewer",
|
|
1417
|
+
"reviewer-nonzero",
|
|
1418
|
+
"--runner-command-json",
|
|
1419
|
+
json.dumps([sys.executable, str(runner_path)]),
|
|
1420
|
+
check=False,
|
|
1421
|
+
)
|
|
1422
|
+
self.assertNotEqual(0, rejected.returncode)
|
|
1423
|
+
self.assertIn("cannot be bypassed", rejected.stdout + rejected.stderr)
|
|
1424
|
+
status = json.loads(
|
|
1425
|
+
self.ap(worktree, "task-status", "REVIEW-NONZERO", "--json").stdout
|
|
1426
|
+
)["tasks"][0]
|
|
1427
|
+
review = status["review"]
|
|
1428
|
+
self.assertEqual("changes-requested", review["verdict"])
|
|
1429
|
+
self.assertEqual("blocked", review["runtime_state"])
|
|
1430
|
+
self.assertEqual(7, review["runtime_exit_code"])
|
|
1431
|
+
result = json.loads(Path(review["runtime_result_path"]).read_text())
|
|
1432
|
+
self.assertEqual("specific defect", result["summary"])
|
|
1433
|
+
receipt = json.loads(Path(review["runtime_receipt_path"]).read_text())
|
|
1434
|
+
self.assertEqual("blocked", receipt["status"])
|
|
1435
|
+
self.assertEqual("changes-requested", receipt["verdict"])
|
|
1436
|
+
self.assertEqual(7, receipt["exit_code"])
|
|
1437
|
+
|
|
1364
1438
|
def test_substantive_agent_message_before_timeout_cannot_be_bypassed(self) -> None:
|
|
1365
1439
|
root, repo, _ = self.make_repo()
|
|
1366
1440
|
worktree = self.start_task(repo, "REVIEW-EVENT-FINDING", "shared.txt")
|
|
@@ -1855,13 +1929,23 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
1855
1929
|
"origin/dev",
|
|
1856
1930
|
"--owned-path",
|
|
1857
1931
|
".",
|
|
1858
|
-
"--writer",
|
|
1859
|
-
"fixer-label",
|
|
1860
1932
|
)
|
|
1861
1933
|
worktree = self.task_worktree(repo, "LEASE-1")
|
|
1862
1934
|
(worktree / "lease.txt").write_text("ready\n", encoding="utf-8")
|
|
1863
1935
|
self.approve_task(worktree, "LEASE-1")
|
|
1864
1936
|
|
|
1937
|
+
self.ap(
|
|
1938
|
+
repo,
|
|
1939
|
+
"task-handoff",
|
|
1940
|
+
"LEASE-1",
|
|
1941
|
+
"--from",
|
|
1942
|
+
owner,
|
|
1943
|
+
"--to",
|
|
1944
|
+
"fixer-label",
|
|
1945
|
+
"--generation",
|
|
1946
|
+
"1",
|
|
1947
|
+
)
|
|
1948
|
+
|
|
1865
1949
|
mismatch = self.ap(
|
|
1866
1950
|
worktree,
|
|
1867
1951
|
"commit-push",
|
|
@@ -1895,7 +1979,7 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
1895
1979
|
"--to",
|
|
1896
1980
|
owner,
|
|
1897
1981
|
"--generation",
|
|
1898
|
-
"
|
|
1982
|
+
"2",
|
|
1899
1983
|
)
|
|
1900
1984
|
stale = self.ap(
|
|
1901
1985
|
repo,
|
|
@@ -1906,14 +1990,14 @@ class AutoCodingConcurrencyTests(unittest.TestCase):
|
|
|
1906
1990
|
"--to",
|
|
1907
1991
|
"next-writer",
|
|
1908
1992
|
"--generation",
|
|
1909
|
-
"
|
|
1993
|
+
"2",
|
|
1910
1994
|
check=False,
|
|
1911
1995
|
)
|
|
1912
1996
|
self.assertNotEqual(0, stale.returncode)
|
|
1913
1997
|
self.assertIn("generation changed", stale.stdout + stale.stderr)
|
|
1914
1998
|
manifest = json.loads(self.registry_manifest_path(repo, "LEASE-1").read_text(encoding="utf-8"))
|
|
1915
1999
|
self.assertEqual(owner, manifest["writer_lease"]["holder"])
|
|
1916
|
-
self.assertEqual(
|
|
2000
|
+
self.assertEqual(3, manifest["writer_lease"]["generation"])
|
|
1917
2001
|
|
|
1918
2002
|
def test_dependency_sha_must_already_be_in_task_base(self) -> None:
|
|
1919
2003
|
_, repo, _ = self.make_repo()
|
|
@@ -8,6 +8,8 @@ import hashlib
|
|
|
8
8
|
import io
|
|
9
9
|
import json
|
|
10
10
|
import os
|
|
11
|
+
import re
|
|
12
|
+
import shlex
|
|
11
13
|
import signal
|
|
12
14
|
import subprocess
|
|
13
15
|
import sys
|
|
@@ -192,6 +194,18 @@ class AutoCodingProfileTests(unittest.TestCase):
|
|
|
192
194
|
self.assertTrue(registry_path.exists())
|
|
193
195
|
self.assertEqual(b"immutable evidence\n", evidence_path.read_bytes())
|
|
194
196
|
|
|
197
|
+
def test_review_directory_read_validation_is_mutation_free(self) -> None:
|
|
198
|
+
repo, _ = self.make_repo()
|
|
199
|
+
review_dir = ap._task_review_dir(repo, "READ-ONLY-GUARD", create=True)
|
|
200
|
+
common_dir = ap._git_common_dir(repo).resolve()
|
|
201
|
+
|
|
202
|
+
with mock.patch.object(Path, "chmod", side_effect=PermissionError("read-only sandbox")):
|
|
203
|
+
ap._guard_review_directory(review_dir, common_dir, create=False)
|
|
204
|
+
|
|
205
|
+
os.chmod(review_dir, 0o755)
|
|
206
|
+
with self.assertRaisesRegex(APError, "must use mode 0700"):
|
|
207
|
+
ap._guard_review_directory(review_dir, common_dir, create=False)
|
|
208
|
+
|
|
195
209
|
@staticmethod
|
|
196
210
|
def write_config(repo: Path, cfg: dict) -> None:
|
|
197
211
|
path = repo / "docs" / "ENGINEERING.md"
|
|
@@ -791,7 +805,14 @@ class AutoCodingProfileTests(unittest.TestCase):
|
|
|
791
805
|
'developer_instructions = "review only the immutable artifact"\n',
|
|
792
806
|
encoding="utf-8",
|
|
793
807
|
)
|
|
794
|
-
|
|
808
|
+
runtime_python_path = repo / "Python Runtime" / "bin" / "python3"
|
|
809
|
+
runtime_python_path.parent.mkdir(parents=True)
|
|
810
|
+
runtime_python_path.symlink_to(Path(sys.executable))
|
|
811
|
+
runtime_python = str(runtime_python_path)
|
|
812
|
+
with (
|
|
813
|
+
mock.patch.object(ap.shutil, "which", return_value="/usr/local/bin/codex"),
|
|
814
|
+
mock.patch.object(ap.sys, "executable", runtime_python),
|
|
815
|
+
):
|
|
795
816
|
focused = ap._codex_reviewer_command(
|
|
796
817
|
repo,
|
|
797
818
|
assignment_path,
|
|
@@ -814,7 +835,30 @@ class AutoCodingProfileTests(unittest.TestCase):
|
|
|
814
835
|
self.assertIn('model_reasoning_effort="xhigh"', deep)
|
|
815
836
|
self.assertEqual("vendor/reviewer-model", focused[focused.index("--model") + 1])
|
|
816
837
|
prompt = focused[-1]
|
|
817
|
-
|
|
838
|
+
runtime_python = os.path.abspath(runtime_python)
|
|
839
|
+
self.assertTrue(Path(runtime_python).is_symlink())
|
|
840
|
+
runtime_script = str(Path(ap.__file__).resolve())
|
|
841
|
+
artifact_match = re.search(r"Before analysis, run `([^`]+)`;", prompt)
|
|
842
|
+
self.assertIsNotNone(artifact_match)
|
|
843
|
+
self.assertEqual(
|
|
844
|
+
[runtime_python, runtime_script, "review-artifact", "--file", str(assignment_path)],
|
|
845
|
+
shlex.split(artifact_match.group(1)),
|
|
846
|
+
)
|
|
847
|
+
template_match = re.search(r"Use `([^`]+)` when useful", prompt)
|
|
848
|
+
self.assertIsNotNone(template_match)
|
|
849
|
+
self.assertEqual(
|
|
850
|
+
[
|
|
851
|
+
runtime_python,
|
|
852
|
+
runtime_script,
|
|
853
|
+
"agent-result-template",
|
|
854
|
+
"--file",
|
|
855
|
+
str(assignment_path),
|
|
856
|
+
"--verdict",
|
|
857
|
+
"approved",
|
|
858
|
+
],
|
|
859
|
+
shlex.split(template_match.group(1)),
|
|
860
|
+
)
|
|
861
|
+
self.assertNotIn("docs/tools/autopipeline/ap.py", prompt)
|
|
818
862
|
self.assertIn("diff_artifact_sha256", prompt)
|
|
819
863
|
self.assertIn("never substitute a live git diff", prompt)
|
|
820
864
|
developer_override = next(
|
|
@@ -2871,6 +2915,68 @@ class AutoCodingProfileTests(unittest.TestCase):
|
|
|
2871
2915
|
self.assertTrue(plan["review_required"])
|
|
2872
2916
|
self.assertIn("release_or_tooling", plan["categories"])
|
|
2873
2917
|
|
|
2918
|
+
def test_root_agents_protocol_is_high_risk_release_tooling(self) -> None:
|
|
2919
|
+
repo, cfg = self.make_repo()
|
|
2920
|
+
plan = self.plan(
|
|
2921
|
+
repo,
|
|
2922
|
+
cfg,
|
|
2923
|
+
planned_paths=["AGENTS.md"],
|
|
2924
|
+
requested_task_kind="change",
|
|
2925
|
+
)
|
|
2926
|
+
self.assertEqual("high-risk", plan["profile"])
|
|
2927
|
+
self.assertTrue(plan["review_required"])
|
|
2928
|
+
self.assertIn("release_or_tooling", plan["categories"])
|
|
2929
|
+
|
|
2930
|
+
def test_generic_migration_language_and_managed_policy_are_not_database_risk(self) -> None:
|
|
2931
|
+
repo, cfg = self.make_repo()
|
|
2932
|
+
plan = self.plan(
|
|
2933
|
+
repo,
|
|
2934
|
+
cfg,
|
|
2935
|
+
planned_paths=["docs/project/overlay-migration.md"],
|
|
2936
|
+
intent="Document project overlay migration behavior",
|
|
2937
|
+
requested_task_kind="change",
|
|
2938
|
+
)
|
|
2939
|
+
self.assertNotIn("db", plan["categories"])
|
|
2940
|
+
self.assertNotIn("db", plan["intent_categories"])
|
|
2941
|
+
self.assertNotIn("db", plan["high_confidence_intent_categories"])
|
|
2942
|
+
self.assertNotIn(
|
|
2943
|
+
"db",
|
|
2944
|
+
ap._classify_paths(
|
|
2945
|
+
[".agents/skills/auto-coding-skill/data/policies/workflow-migrations-v1.json"]
|
|
2946
|
+
)["categories"],
|
|
2947
|
+
)
|
|
2948
|
+
self.assertNotIn(
|
|
2949
|
+
"db",
|
|
2950
|
+
ap._classify_paths(
|
|
2951
|
+
["src/auto-coding-skill/data/policies/workflow-migrations-v1.json"]
|
|
2952
|
+
)["categories"],
|
|
2953
|
+
)
|
|
2954
|
+
self.assertIn("db", ap._classify_paths(["migrations/001.sql"])["categories"])
|
|
2955
|
+
|
|
2956
|
+
def test_database_named_source_files_remain_high_risk(self) -> None:
|
|
2957
|
+
repo, cfg = self.make_repo()
|
|
2958
|
+
for path in [
|
|
2959
|
+
"src/db.py",
|
|
2960
|
+
"src/database.py",
|
|
2961
|
+
"src/schema.py",
|
|
2962
|
+
"src/migrations.py",
|
|
2963
|
+
"internal/db.go",
|
|
2964
|
+
"backend/db_migrations/001.py",
|
|
2965
|
+
"backend/database-migrations/001.py",
|
|
2966
|
+
"backend/schema_migrations/001.py",
|
|
2967
|
+
"backend/db-migrations/001.py",
|
|
2968
|
+
]:
|
|
2969
|
+
with self.subTest(path=path):
|
|
2970
|
+
self.assertIn("db", ap._classify_paths([path])["categories"])
|
|
2971
|
+
plan = self.plan(
|
|
2972
|
+
repo,
|
|
2973
|
+
cfg,
|
|
2974
|
+
planned_paths=[path],
|
|
2975
|
+
requested_task_kind="change",
|
|
2976
|
+
)
|
|
2977
|
+
self.assertEqual("high-risk", plan["profile"])
|
|
2978
|
+
self.assertTrue(plan["review_required"])
|
|
2979
|
+
|
|
2874
2980
|
def test_explicit_full_structure_scope_inspects_clean_tracked_files(self) -> None:
|
|
2875
2981
|
cfg = base_config()
|
|
2876
2982
|
cfg["structure"] = {
|
|
@@ -87,7 +87,7 @@ class ProjectConfigResolverTests(unittest.TestCase):
|
|
|
87
87
|
(self.repo / "docs" / "project").mkdir(parents=True)
|
|
88
88
|
self.write_managed(
|
|
89
89
|
"""workflow:
|
|
90
|
-
skill_version: "4.3.
|
|
90
|
+
skill_version: "4.3.3"
|
|
91
91
|
mode: dev
|
|
92
92
|
profile: auto
|
|
93
93
|
completion: push
|
|
@@ -130,7 +130,7 @@ access:
|
|
|
130
130
|
effective = core.load_effective_config(self.repo)
|
|
131
131
|
|
|
132
132
|
self.assertEqual("sample", effective["project"]["name"])
|
|
133
|
-
self.assertEqual("4.3.
|
|
133
|
+
self.assertEqual("4.3.3", effective["workflow"]["skill_version"])
|
|
134
134
|
self.assertEqual(self.repo / "docs" / "ENGINEERING.md", core.find_config(self.repo))
|
|
135
135
|
self.assertEqual({}, core.load_project_overrides(self.repo))
|
|
136
136
|
|
|
@@ -153,7 +153,7 @@ access:
|
|
|
153
153
|
|
|
154
154
|
effective = core.load_effective_config(self.repo)
|
|
155
155
|
|
|
156
|
-
self.assertEqual("4.3.
|
|
156
|
+
self.assertEqual("4.3.3", effective["workflow"]["skill_version"])
|
|
157
157
|
self.assertEqual("dev", effective["workflow"]["mode"])
|
|
158
158
|
self.assertEqual("project-profile", effective["workflow"]["profile"])
|
|
159
159
|
self.assertEqual("push", effective["workflow"]["completion"])
|
|
@@ -292,11 +292,11 @@ access:
|
|
|
292
292
|
|
|
293
293
|
def test_large_managed_body_is_not_part_of_frontmatter_bound(self) -> None:
|
|
294
294
|
self.write_managed(
|
|
295
|
-
'workflow:\n skill_version: "4.3.
|
|
295
|
+
'workflow:\n skill_version: "4.3.3"\n',
|
|
296
296
|
body="x" * (core.MANAGED_CONFIG_FRONTMATTER_MAX_BYTES + 1),
|
|
297
297
|
)
|
|
298
298
|
|
|
299
|
-
self.assertEqual("4.3.
|
|
299
|
+
self.assertEqual("4.3.3", core.load_effective_config(self.repo)["workflow"]["skill_version"])
|
|
300
300
|
|
|
301
301
|
def test_yaml_failure_does_not_echo_content_or_absolute_path(self) -> None:
|
|
302
302
|
secret = "NEVER_ECHO_THIS_SECRET"
|
package/cli/tests/index.test.js
CHANGED
|
@@ -422,8 +422,8 @@ function testInitFullyConvergesExistingProject() {
|
|
|
422
422
|
}
|
|
423
423
|
assert(exists(path.join(repo, ".agents", "agents", "custom.toml")), "project-owned custom agents must survive init");
|
|
424
424
|
assert(!exists(path.join(repo, ".agents", "skills", "auto-coding-skill", "obsolete.txt")), "extra Skill files must be removed");
|
|
425
|
-
assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
426
|
-
assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
425
|
+
assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3", "docs", "legacy", "old-taskbook.md")), "removed docs must be archived outside active docs");
|
|
426
|
+
assert(exists(path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3", "docs", "legacy", "orphan.bin")), "unowned legacy binary assets must still be archived");
|
|
427
427
|
assert(fs.readFileSync(structureStandard, "utf8") === customStructureStandard, "init must preserve a project-owned structure standard");
|
|
428
428
|
assert(fs.readFileSync(path.join(repo, "docs", "architecture", "adr", "0042-project-choice.md"), "utf8").includes("Keep me"), "numbered ADR artifacts must survive init");
|
|
429
429
|
assert(fs.readFileSync(path.join(repo, "docs", "architecture", "system-context.md"), "utf8").includes("Keep me"), "architecture artifacts must survive init");
|
|
@@ -538,12 +538,12 @@ function testManagedPolicySummaryPreservesProjectConfiguration() {
|
|
|
538
538
|
const legacySummary = "- `structure` and `optimization`: advisory architecture and no-new-debt policy.";
|
|
539
539
|
const installedOldDefault = current
|
|
540
540
|
.replace(/^ skill_version:.*$/m, " skill_version: 4.2.5")
|
|
541
|
-
.replace("managed-workflow:start version=4.3.
|
|
541
|
+
.replace("managed-workflow:start version=4.3.3", "managed-workflow:start version=4.2.5")
|
|
542
542
|
.replace(neutralSummary, legacySummary);
|
|
543
543
|
installTrustedEngineeringDefault(repo, installedOldDefault, "4.2.5");
|
|
544
544
|
const customized = current
|
|
545
545
|
.replace(/^ skill_version:.*$/m, " skill_version: 4.2.5")
|
|
546
|
-
.replace("managed-workflow:start version=4.3.
|
|
546
|
+
.replace("managed-workflow:start version=4.3.3", "managed-workflow:start version=4.2.5")
|
|
547
547
|
.replace(neutralSummary, legacySummary)
|
|
548
548
|
.replace(/^ enforcement:.*$/m, " enforcement: blocking")
|
|
549
549
|
.replace(" block_warnings: false", " block_warnings: true")
|
|
@@ -562,7 +562,7 @@ function testManagedPolicySummaryPreservesProjectConfiguration() {
|
|
|
562
562
|
const upgraded = fs.readFileSync(engineering, "utf8");
|
|
563
563
|
const managedAfterUpgrade = readEngineeringConfig(engineering);
|
|
564
564
|
const afterUpgrade = readEffectiveConfig(repo);
|
|
565
|
-
assert(managedAfterUpgrade.workflow?.skill_version === "4.3.
|
|
565
|
+
assert(managedAfterUpgrade.workflow?.skill_version === "4.3.3", "init must upgrade the managed workflow version");
|
|
566
566
|
assert(canonicalJson(afterUpgrade.structure) === canonicalJson(beforeUpgrade.structure), "init must preserve the complete project structure policy");
|
|
567
567
|
assert(canonicalJson(afterUpgrade.optimization) === canonicalJson(beforeUpgrade.optimization), "init must preserve the complete project optimization policy");
|
|
568
568
|
assert(upgraded.includes(neutralSummary), "upgraded managed text must defer to frontmatter policy");
|
|
@@ -1213,7 +1213,7 @@ function testTamperedInstalledDefaultRejectsInitAndSyncWithoutWrites() {
|
|
|
1213
1213
|
const skill = path.join(repo, ".agents", "skills", "auto-coding-skill", "SKILL.md");
|
|
1214
1214
|
const oldDefault = fs.readFileSync(engineering, "utf8")
|
|
1215
1215
|
.replace(/^ skill_version:.*$/m, ' skill_version: "4.2.7"')
|
|
1216
|
-
.replace("managed-workflow:start version=4.3.
|
|
1216
|
+
.replace("managed-workflow:start version=4.3.3", "managed-workflow:start version=4.2.7");
|
|
1217
1217
|
installTrustedEngineeringDefault(repo, oldDefault, "4.2.7");
|
|
1218
1218
|
writeFile(engineering, oldDefault);
|
|
1219
1219
|
fs.unlinkSync(overlay);
|
|
@@ -1502,7 +1502,7 @@ function testArchiveFallbackCollisionsNeverLosePreviousContent() {
|
|
|
1502
1502
|
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
1503
1503
|
fs.appendFileSync(engineering, "\n## Archive collision sentinel\n\nPreserve these ENGINEERING bytes.\n");
|
|
1504
1504
|
const previous = fs.readFileSync(engineering);
|
|
1505
|
-
const archiveDir = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
1505
|
+
const archiveDir = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3", "docs");
|
|
1506
1506
|
const preferred = path.join(archiveDir, "ENGINEERING.md");
|
|
1507
1507
|
const legacyDigest = path.join(archiveDir, `ENGINEERING-${digest12(previous)}.md`);
|
|
1508
1508
|
const occupiedPreferred = Buffer.from("occupied-engineering-default\n");
|
|
@@ -1532,7 +1532,7 @@ function testArchiveFallbackCollisionsNeverLosePreviousContent() {
|
|
|
1532
1532
|
".agents",
|
|
1533
1533
|
"archive",
|
|
1534
1534
|
"auto-coding-skill",
|
|
1535
|
-
"4.3.
|
|
1535
|
+
"4.3.3",
|
|
1536
1536
|
"docs",
|
|
1537
1537
|
"design",
|
|
1538
1538
|
);
|
|
@@ -1557,7 +1557,7 @@ function testArchiveFallbackCollisionsNeverLosePreviousContent() {
|
|
|
1557
1557
|
const agents = path.join(repo, "AGENTS.md");
|
|
1558
1558
|
const previous = Buffer.from("# Project AGENTS before sync\n\nPreserve this sync history.\n");
|
|
1559
1559
|
fs.writeFileSync(agents, previous);
|
|
1560
|
-
const archiveDir = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
1560
|
+
const archiveDir = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3");
|
|
1561
1561
|
const preferred = path.join(archiveDir, "AGENTS.md");
|
|
1562
1562
|
const legacyDigest = path.join(archiveDir, `AGENTS-${digest12(previous)}.md`);
|
|
1563
1563
|
const occupiedPreferred = Buffer.from("occupied-sync-default\n");
|
|
@@ -1579,7 +1579,7 @@ function testArchiveFallbackCollisionsNeverLosePreviousContent() {
|
|
|
1579
1579
|
const agents = path.join(repo, "AGENTS.md");
|
|
1580
1580
|
const previous = Buffer.from("# Project AGENTS before init\n\nPreserve this init history.\n");
|
|
1581
1581
|
fs.writeFileSync(agents, previous);
|
|
1582
|
-
const archiveDir = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
1582
|
+
const archiveDir = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3");
|
|
1583
1583
|
const preferred = path.join(archiveDir, "AGENTS.md");
|
|
1584
1584
|
const legacyDigest = path.join(archiveDir, `AGENTS-${digest12(previous)}.md`);
|
|
1585
1585
|
const occupiedPreferred = Buffer.from("occupied-init-default\n");
|
|
@@ -2209,7 +2209,7 @@ function testCliInstallArchivesFeedbackTemplatesAndPreservesReports() {
|
|
|
2209
2209
|
writeFile(report, reportContent);
|
|
2210
2210
|
|
|
2211
2211
|
run("node", [cli, "init"], { cwd: repo });
|
|
2212
|
-
const archive = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
2212
|
+
const archive = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3", "docs", "skill-feedback", "README.md");
|
|
2213
2213
|
assert(fs.readFileSync(feedbackReadme, "utf8").includes("Auto Coding Skill Feedback"), "transactional init must install the managed feedback README");
|
|
2214
2214
|
assert(fs.readFileSync(archive, "utf8") === previousReadme, "transactional init must archive a pre-existing feedback README before replacement");
|
|
2215
2215
|
assert(fs.readFileSync(report, "utf8") === reportContent, "transactional init must preserve project feedback reports byte-for-byte");
|
|
@@ -2304,7 +2304,7 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
|
|
|
2304
2304
|
|
|
2305
2305
|
const engineering = path.join(repo, "docs", "ENGINEERING.md");
|
|
2306
2306
|
const initial = fs.readFileSync(engineering, "utf8");
|
|
2307
|
-
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.3\.
|
|
2307
|
+
const startPattern = /<!-- auto-coding-skill:managed-workflow:start version=4\.3\.3 -->/;
|
|
2308
2308
|
const endMarker = "<!-- auto-coding-skill:managed-workflow:end -->";
|
|
2309
2309
|
assert(startPattern.test(initial), "new projects should include a versioned managed workflow marker");
|
|
2310
2310
|
assert(initial.includes(endMarker), "new projects should include the managed workflow end marker");
|
|
@@ -2318,21 +2318,21 @@ function testManagedEngineeringInitIsAuthoritativeAndIdempotent() {
|
|
|
2318
2318
|
const dryRun = run("node", [cli, "sync", "--projects", repo, "--dry-run", "--json"]);
|
|
2319
2319
|
const dryResult = JSON.parse(dryRun.stdout).results[0];
|
|
2320
2320
|
assert(dryResult.managedWorkflow.state === "stale", `dry-run should expose stale workflow state: ${dryRun.stdout}`);
|
|
2321
|
-
assert(dryResult.managedWorkflow.version === "4.3.
|
|
2321
|
+
assert(dryResult.managedWorkflow.version === "4.3.3", "dry-run should expose the target workflow version");
|
|
2322
2322
|
assert(dryResult.actions.some(item => item.action === "would-replace" && item.path === "docs/ENGINEERING.md"), "dry-run should plan exact replacement of the managed default document");
|
|
2323
2323
|
assert(fs.readFileSync(engineering, "utf8") === customized, "dry-run must not write ENGINEERING.md");
|
|
2324
2324
|
|
|
2325
2325
|
run("node", [cli, "init"], { cwd: repo });
|
|
2326
2326
|
const updated = fs.readFileSync(engineering, "utf8");
|
|
2327
2327
|
assert(!updated.includes("project note before") && !updated.includes("project note after"), "init must remove text outside the canonical ENGINEERING body");
|
|
2328
|
-
assert(updated.includes("version=4.3.
|
|
2328
|
+
assert(updated.includes("version=4.3.3"), "init should install the current managed workflow version");
|
|
2329
2329
|
assert(updated.includes("The frontmatter contract is:"), "init should refresh stale managed workflow content");
|
|
2330
2330
|
|
|
2331
2331
|
fillRequiredAccess(repo);
|
|
2332
2332
|
const status = run("node", [cli, "status", "--projects", repo, "--json"]);
|
|
2333
2333
|
const statusResult = JSON.parse(status.stdout).results[0];
|
|
2334
2334
|
assert(statusResult.managedWorkflow.state === "current", `status should expose current managed workflow state: ${status.stdout}`);
|
|
2335
|
-
assert(statusResult.managedWorkflow.version === "4.3.
|
|
2335
|
+
assert(statusResult.managedWorkflow.version === "4.3.3", "status should expose the installed managed workflow version");
|
|
2336
2336
|
|
|
2337
2337
|
const beforeSecondInit = fs.readFileSync(engineering, "utf8");
|
|
2338
2338
|
run("node", [cli, "init"], { cwd: repo });
|
|
@@ -2360,9 +2360,9 @@ function testLegacyEngineeringMigrationPreservesExistingBody() {
|
|
|
2360
2360
|
assert(dryResult.actions.some(item => item.action === "would-archive" && item.path.endsWith("/docs/ENGINEERING.md")), "custom legacy migration must plan archival before replacement");
|
|
2361
2361
|
run("node", [cli, "sync", "--projects", repo]);
|
|
2362
2362
|
const migrated = fs.readFileSync(engineering, "utf8");
|
|
2363
|
-
assert(migrated.includes("version=4.3.
|
|
2363
|
+
assert(migrated.includes("version=4.3.3"), "legacy migration should insert the current managed workflow");
|
|
2364
2364
|
assert(!migrated.includes(legacyNote), "legacy project text must not remain in the exact managed default document");
|
|
2365
|
-
const archive = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
2365
|
+
const archive = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3", "docs", "ENGINEERING.md");
|
|
2366
2366
|
assert(fs.readFileSync(archive, "utf8").includes(legacyNote), "legacy migration must preserve the complete previous body in history");
|
|
2367
2367
|
const stable = fs.readFileSync(engineering, "utf8");
|
|
2368
2368
|
run("node", [cli, "sync", "--projects", repo]);
|
|
@@ -2390,7 +2390,7 @@ function testOfficialLegacyEngineeringBodyIsReplacedWithoutDuplication() {
|
|
|
2390
2390
|
assert(migrated === canonicalEngineering, "official legacy migration must install the exact managed default document");
|
|
2391
2391
|
assert((migrated.match(/auto-coding-skill:managed-workflow:start/g) || []).length === 1, "official legacy migration should install exactly one managed workflow");
|
|
2392
2392
|
assert((migrated.match(/^## Execution profiles$/gm) || []).length === 0, "official legacy migration must remove the old duplicated workflow body");
|
|
2393
|
-
const archive = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
2393
|
+
const archive = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3", "docs", "ENGINEERING.md");
|
|
2394
2394
|
assert(fs.readFileSync(archive, "utf8").includes("## Execution profiles"), "official legacy body must remain available in the historical archive");
|
|
2395
2395
|
|
|
2396
2396
|
const stable = fs.readFileSync(engineering, "utf8");
|
|
@@ -2465,7 +2465,7 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
|
|
|
2465
2465
|
run("node", [cli, "sync", "--projects", repo]);
|
|
2466
2466
|
const agents = path.join(repo, "AGENTS.md");
|
|
2467
2467
|
const initial = fs.readFileSync(agents, "utf8");
|
|
2468
|
-
assert(initial.includes("managed-agents:start version=4.3.
|
|
2468
|
+
assert(initial.includes("managed-agents:start version=4.3.3"), "new projects should receive the versioned root AGENTS block");
|
|
2469
2469
|
|
|
2470
2470
|
const custom = [
|
|
2471
2471
|
"# Project rules",
|
|
@@ -2487,15 +2487,15 @@ function testManagedAgentsMigrationReplacesWholeFileAndArchivesPreviousRules() {
|
|
|
2487
2487
|
|
|
2488
2488
|
run("node", [cli, "sync", "--projects", repo]);
|
|
2489
2489
|
const migrated = fs.readFileSync(agents, "utf8");
|
|
2490
|
-
assert(migrated.includes("managed-agents:start version=4.3.
|
|
2490
|
+
assert(migrated.includes("managed-agents:start version=4.3.3"), "AGENTS migration should install the current managed block");
|
|
2491
2491
|
assert(!migrated.includes("Preserve this repository-specific rule exactly."), "root AGENTS must contain no project-specific tail");
|
|
2492
2492
|
assert(!migrated.includes("must execute `commands.gate_full`"), "known official conflicting rule should be removed");
|
|
2493
2493
|
const canonical = fs.readFileSync(path.join(repoRoot, "cli", "assets", "skill", "data", "templates", "bridges", "AGENTS.md"), "utf8");
|
|
2494
2494
|
assert(migrated === canonical, "root AGENTS must be byte-identical to the packaged canonical file");
|
|
2495
|
-
const archive = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
2495
|
+
const archive = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3", "AGENTS.md");
|
|
2496
2496
|
assert(fs.readFileSync(archive, "utf8").includes("Preserve this repository-specific rule exactly."), "previous AGENTS content must be archived once");
|
|
2497
2497
|
assert(!exists(legacyActiveArchive), "legacy active-doc AGENTS archives must leave docs/archive during upgrade");
|
|
2498
|
-
const migratedLegacyArchiveDir = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
2498
|
+
const migratedLegacyArchiveDir = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3", "docs", "archive", "workflow");
|
|
2499
2499
|
assert(
|
|
2500
2500
|
listProjectFiles(migratedLegacyArchiveDir).some(file => fs.readFileSync(file).equals(legacyActiveArchiveBytes)),
|
|
2501
2501
|
"legacy active-doc AGENTS archive bytes must survive under the managed archive root",
|
|
@@ -2553,7 +2553,7 @@ function testEngineeringMarkerBoundaryIsNormalized() {
|
|
|
2553
2553
|
const normalized = fs.readFileSync(engineering, "utf8");
|
|
2554
2554
|
assert(normalized === current, "sync should restore the exact managed document when text is glued to its end marker");
|
|
2555
2555
|
assert(!normalized.includes("# Project-specific workflow"), "project workflow text must not remain in the managed default document");
|
|
2556
|
-
const archive = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
2556
|
+
const archive = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3", "docs", "ENGINEERING.md");
|
|
2557
2557
|
assert(fs.readFileSync(archive, "utf8").includes(`${marker}# Project-specific workflow`), "the malformed previous document must remain available in history");
|
|
2558
2558
|
}
|
|
2559
2559
|
|
|
@@ -2570,7 +2570,7 @@ function testEngineeringFrameworkRejectsAnyNonCanonicalWorkflowText() {
|
|
|
2570
2570
|
|
|
2571
2571
|
run("node", [cli, "init"], { cwd: repo });
|
|
2572
2572
|
assert(!fs.readFileSync(engineering, "utf8").includes("backend owns APIs"), "init must restore the canonical ENGINEERING body");
|
|
2573
|
-
const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.
|
|
2573
|
+
const archived = path.join(repo, ".agents", "archive", "auto-coding-skill", "4.3.3", "docs", "ENGINEERING.md");
|
|
2574
2574
|
assert(fs.readFileSync(archived, "utf8").includes("backend owns APIs"), "removed project text should remain in non-authoritative history");
|
|
2575
2575
|
}
|
|
2576
2576
|
|
|
@@ -2582,12 +2582,12 @@ function testManagedInstallIntegrityIsBoundedAndRepairable() {
|
|
|
2582
2582
|
|
|
2583
2583
|
const manifestPath = path.join(repo, ".agents", "managed-install.json");
|
|
2584
2584
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
2585
|
-
assert(manifest.schema_version === 1 && manifest.skill_version === "4.3.
|
|
2585
|
+
assert(manifest.schema_version === 1 && manifest.skill_version === "4.3.3", "installed manifest must identify the release");
|
|
2586
2586
|
assert(manifest.entries.length > 0, "installed manifest must list managed files");
|
|
2587
2587
|
for (const entry of manifest.entries) {
|
|
2588
2588
|
assert(typeof entry.path === "string" && !path.isAbsolute(entry.path) && !entry.path.includes(".."), "manifest paths must be safe relative paths");
|
|
2589
2589
|
assert(/^[0-9a-f]{64}$/.test(entry.sha256), `${entry.path}: manifest hash must be sha256`);
|
|
2590
|
-
assert(entry.version === "4.3.
|
|
2590
|
+
assert(entry.version === "4.3.3" && typeof entry.executable === "boolean", `${entry.path}: version/executable metadata missing`);
|
|
2591
2591
|
}
|
|
2592
2592
|
assert(!manifest.managed_namespaces.some(item => item.path === ".agents" || item.path === "docs"), "manifest must not mirror entire project-owned trees");
|
|
2593
2593
|
|
|
@@ -2663,6 +2663,11 @@ function testSkillFeedbackCollectionIsBoundedReadOnlyAndMetadataOnly() {
|
|
|
2663
2663
|
run("node", [cli, "init"], { cwd: first });
|
|
2664
2664
|
run("node", [cli, "init"], { cwd: second });
|
|
2665
2665
|
run("node", [cli, "init"], { cwd: third });
|
|
2666
|
+
const emptyStatus = JSON.parse(
|
|
2667
|
+
run("node", [cli, "status", "--projects", third, "--json"], { check: false }).stdout,
|
|
2668
|
+
).results[0];
|
|
2669
|
+
assert(emptyStatus.feedback.available === true, "status must expose feedback before the first report");
|
|
2670
|
+
assert(emptyStatus.feedback.skillVersion === "4.3.3", "empty feedback status must expose the installed Skill version");
|
|
2666
2671
|
const signature = `sha256:${"a".repeat(64)}`;
|
|
2667
2672
|
const marker = path.join(os.tmpdir(), `autocoding-feedback-must-not-execute-${crypto.randomUUID()}`);
|
|
2668
2673
|
const render = (project, reportId, privateMarker) => [
|
|
@@ -2672,7 +2677,7 @@ function testSkillFeedbackCollectionIsBoundedReadOnlyAndMetadataOnly() {
|
|
|
2672
2677
|
"status: open",
|
|
2673
2678
|
'created_at: "2026-07-18T10:00:00+08:00"',
|
|
2674
2679
|
`project: ${project}`,
|
|
2675
|
-
"observed_skill_version: 4.3.
|
|
2680
|
+
"observed_skill_version: 4.3.3",
|
|
2676
2681
|
"component: reviewer-runtime",
|
|
2677
2682
|
"kind: defect",
|
|
2678
2683
|
"impact: blocking",
|
|
@@ -2706,7 +2711,7 @@ function testSkillFeedbackCollectionIsBoundedReadOnlyAndMetadataOnly() {
|
|
|
2706
2711
|
.replace("schema: auto-coding-skill-feedback/v1", "schema: auto-coding-skill-feedback/v2")
|
|
2707
2712
|
.replace("status: open", `status: ${options.status ?? "open"}`)
|
|
2708
2713
|
.replace('created_at: "2026-07-18T10:00:00+08:00"', 'created_at: "2026-07-18T10:00:00+08:00"\nupdated_at: "2026-07-19T10:00:00+08:00"')
|
|
2709
|
-
.replace("observed_skill_version: 4.3.
|
|
2714
|
+
.replace("observed_skill_version: 4.3.3", `observed_skill_version: ${options.observed ?? "4.3.3"}\nlast_verified_skill_version: ${options.lastVerified ?? options.observed ?? "4.3.3"}`)
|
|
2710
2715
|
.replace(signature, options.signature)
|
|
2711
2716
|
.replace("export: metadata-only", `resolution: ${options.resolution ?? "pending"}\nexport: metadata-only`);
|
|
2712
2717
|
const firstReport = path.join(first, "docs", "skill-feedback", "reports", "2026-07-18-review-timeout-a13f82c1.md");
|
|
@@ -2765,12 +2770,12 @@ function testSkillFeedbackCollectionIsBoundedReadOnlyAndMetadataOnly() {
|
|
|
2765
2770
|
assert(fs.readFileSync(firstReport, "utf8") === firstContent && fs.readFileSync(firstOtherReport, "utf8") === firstOtherContent && fs.readFileSync(secondReport, "utf8") === secondContent, "collection must not modify reports");
|
|
2766
2771
|
assert(fs.readFileSync(closedReport, "utf8") === closedContent && fs.readFileSync(fixedReport, "utf8") === fixedContent && fs.readFileSync(rerouteReport, "utf8") === rerouteContent, "lifecycle collection must preserve every project-owned report byte-for-byte");
|
|
2767
2772
|
|
|
2768
|
-
writeFile(fixedReport, fixedContent.replace("last_verified_skill_version: 4.3.0", "last_verified_skill_version: 4.3.
|
|
2773
|
+
writeFile(fixedReport, fixedContent.replace("last_verified_skill_version: 4.3.0", "last_verified_skill_version: 4.3.3"));
|
|
2769
2774
|
let lifecycleCheck = JSON.parse(run("node", [cli, "feedback", "--projects", first, "--json"]).stdout);
|
|
2770
2775
|
assert(lifecycleCheck.metadata.find(item => item.report_id === "ACSF-assets-20260718-fd5748e4")?.lifecycle === "regression-current", "a fixed signature reproduced on the fixed release must re-enter active triage as a regression");
|
|
2771
2776
|
writeFile(fixedReport, fixedContent);
|
|
2772
2777
|
|
|
2773
|
-
writeFile(firstOtherReport, firstOtherContent.replace("observed_skill_version: 4.3.
|
|
2778
|
+
writeFile(firstOtherReport, firstOtherContent.replace("observed_skill_version: 4.3.3", "observed_skill_version: 4.2.8"));
|
|
2774
2779
|
lifecycleCheck = JSON.parse(run("node", [cli, "feedback", "--projects", first, "--json"]).stdout);
|
|
2775
2780
|
assert(lifecycleCheck.metadata.find(item => item.report_id === "ACSF-geesight-20260718-c35fa4e3")?.lifecycle === "recheck-due", "an unresolved v1 report from an older Skill version must require recheck");
|
|
2776
2781
|
writeFile(firstOtherReport, firstOtherContent);
|
|
@@ -2820,14 +2825,14 @@ function testSkillFeedbackCollectionIsBoundedReadOnlyAndMetadataOnly() {
|
|
|
2820
2825
|
}
|
|
2821
2826
|
|
|
2822
2827
|
function testReleaseVersionMarkersStayInSync() {
|
|
2823
|
-
const expected = "4.3.
|
|
2828
|
+
const expected = "4.3.3";
|
|
2824
2829
|
const pkg = JSON.parse(fs.readFileSync(path.join(repoRoot, "package.json"), "utf8"));
|
|
2825
2830
|
const lock = JSON.parse(fs.readFileSync(path.join(repoRoot, "package-lock.json"), "utf8"));
|
|
2826
2831
|
const policy = JSON.parse(fs.readFileSync(
|
|
2827
2832
|
path.join(repoRoot, "src", "auto-coding-skill", "data", "policies", "workflow-migrations-v1.json"),
|
|
2828
2833
|
"utf8",
|
|
2829
2834
|
));
|
|
2830
|
-
assert(pkg.version === expected, "package version must match the 4.3.
|
|
2835
|
+
assert(pkg.version === expected, "package version must match the 4.3.3 release");
|
|
2831
2836
|
assert(lock.version === expected && lock.packages[""].version === expected, "package-lock versions must match");
|
|
2832
2837
|
assert(policy.managed_versions.engineering === expected && policy.managed_versions.agents === expected, "managed workflow versions must match");
|
|
2833
2838
|
const manifest = JSON.parse(fs.readFileSync(path.join(repoRoot, "cli", "assets", "managed-install.json"), "utf8"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elvis1513/auto-coding-skill",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.3",
|
|
4
4
|
"description": "CLI installer for a delivery-first .agents workflow with adaptive Git isolation, routed changed-scope validation, risk-based review, push completion, and safe cleanup.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|