@hongmaple0820/scale-engine 0.21.0 → 0.21.2

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.
@@ -56,11 +56,7 @@ export function workspaceTopologyTemplate(options = {}) {
56
56
  services: ['example'],
57
57
  },
58
58
  ],
59
- branchPolicy: {
60
- protectedBranches: ['main', 'master'],
61
- featurePrefixes: ['feature/', 'fix/', 'docs/', 'codex/'],
62
- requireAuthorScopeDate: true,
63
- },
59
+ branchPolicy: defaultBranchPolicy(),
64
60
  finishPolicy: defaultFinishPolicy(topology),
65
61
  };
66
62
  return `${JSON.stringify(config, null, 2)}\n`;
@@ -76,7 +72,10 @@ function normalizeWorkspaceTopology(raw, meta) {
76
72
  version: raw.version ?? 1,
77
73
  topology,
78
74
  repositories,
79
- branchPolicy: raw.branchPolicy,
75
+ branchPolicy: {
76
+ ...defaultBranchPolicy(),
77
+ ...(raw.branchPolicy ?? {}),
78
+ },
80
79
  finishPolicy: {
81
80
  ...defaultFinishPolicy(topology),
82
81
  ...(raw.finishPolicy ?? {}),
@@ -119,6 +118,18 @@ function defaultFinishPolicy(topology) {
119
118
  requireReviewArtifacts: topology === 'moe',
120
119
  };
121
120
  }
121
+ function defaultBranchPolicy() {
122
+ return {
123
+ mode: 'gitlab-flow',
124
+ integrationBranch: 'dev',
125
+ productionBranch: 'master',
126
+ protectedBranches: ['dev', 'master', 'main'],
127
+ featurePrefixes: ['feature/', 'feat/', 'fix/', 'chore/', 'docs/', 'codex/'],
128
+ releasePrefixes: ['release/'],
129
+ hotfixPrefixes: ['hotfix/'],
130
+ requireAuthorScopeDate: true,
131
+ };
132
+ }
122
133
  function normalizeRelative(path) {
123
134
  return path.replace(/\\/g, '/');
124
135
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceTopology.js","sourceRoot":"","sources":["../../src/workflow/WorkspaceTopology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YA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E,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;AACjE,CAAC;AAED,SAAS,mBAAmB,CAAC,QAA+B;IAC1D,OAAO;QACL,wBAAwB,EAAE,IAAI;QAC9B,qBAAqB,EAAE,IAAI;QAC3B,wBAAwB,EAAE,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,qBAAqB;QAClF,sBAAsB,EAAE,QAAQ,KAAK,KAAK;KAC3C,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,iBAAiB,EAAE,KAAK;QACxB,gBAAgB,EAAE,QAAQ;QAC1B,iBAAiB,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC;QAC5C,eAAe,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC;QAC3E,eAAe,EAAE,CAAC,UAAU,CAAC;QAC7B,cAAc,EAAE,CAAC,SAAS,CAAC;QAC3B,sBAAsB,EAAE,IAAI;KAC7B,CAAA;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC"}
@@ -0,0 +1,125 @@
1
+ # GitLab Flow Branch and Worktree Policy
2
+
3
+ SCALE Engine uses a GitLab Flow variant for this repository:
4
+
5
+ ```text
6
+ feat/* / fix/* / chore/* / docs/* / codex/*
7
+ -> dev
8
+ -> master
9
+ -> vX.Y.Z tag
10
+ -> npm publish
11
+
12
+ hotfix:
13
+ fix forward on dev first when possible
14
+ -> cherry-pick to hotfix/*
15
+ -> master
16
+ -> vX.Y.Z tag
17
+ -> sync master back to dev
18
+
19
+ selective release, only when dev contains work that must not ship:
20
+ master
21
+ -> release/vX.Y.Z
22
+ -> cherry-pick selected commits
23
+ -> master
24
+ -> vX.Y.Z tag
25
+ -> sync master back to dev
26
+ ```
27
+
28
+ ## Branch Roles
29
+
30
+ | Branch | Role | Rule |
31
+ | --- | --- | --- |
32
+ | `dev` | Integration and test branch | Merge reviewed short branches here. Do not create direct governed commits on `dev`. |
33
+ | `master` | Production branch | Only verified release/hotfix results land here. Publish from user-created `vX.Y.Z` tags on `master`. |
34
+ | `feat/*`, `feature/*` | Feature branches | Start from current `dev`, merge back to `dev`, then delete. |
35
+ | `fix/*` | Normal bug fix branches | Start from current `dev`, merge back to `dev`, then delete. |
36
+ | `chore/*`, `docs/*`, `codex/*` | Maintenance branches | Short-lived work branches that merge back to `dev`. |
37
+ | `hotfix/*` | Production patch branches | Use only for production fixes. Fix forward to `dev` first when possible, then cherry-pick to hotfix/master. |
38
+ | `release/*` | Selective release branch | Use only when `dev` contains work that must not ship. Start from `master` and cherry-pick the release list. |
39
+
40
+ ## Required Checks
41
+
42
+ Run the release-grade verification set before merging to `master` or tagging:
43
+
44
+ ```bash
45
+ npm run build
46
+ npx vitest run
47
+ git diff --check
48
+ npm pack --dry-run
49
+ ```
50
+
51
+ Every merge request should run the relevant build/lint/test checks before review is accepted. Do not wait until `master` to discover broken tests.
52
+
53
+ ## Merge and Conflict Rules
54
+
55
+ - Public branches are not rebased: `dev`, `master`, `release/*`, and `hotfix/*` keep realistic history.
56
+ - Personal short branches may be rebased before merge, but only with `--force-with-lease` and only before review is accepted.
57
+ - Prefer squash merge from short branches into `dev` when one logical change should be easy to revert.
58
+ - Resolve conflicts on the source branch, rerun verification, then merge. Do not resolve release conflicts directly on `master`.
59
+ - Fix bugs forward first: land the fix on `dev` when possible, then cherry-pick the same commit to `hotfix/*` or the selected patch release branch.
60
+ - Commit messages should explain intent and why the chosen path was selected when the decision is not obvious.
61
+
62
+ ## Ship Gate Rules
63
+
64
+ `scale ship <task-id>` now enforces the branch lifecycle:
65
+
66
+ - blocked on `dev`, `master`, `main`, and detached HEAD
67
+ - allowed on configured short branches such as `feat/*`, `fix/*`, `chore/*`, `docs/*`, `codex/*`, `release/*`, and `hotfix/*`
68
+ - still requires verification evidence, passing review evidence, and reviewed-file-only staging
69
+ - still blocks dirty or unsafe child repositories in MOE/submodule workspaces
70
+
71
+ Use:
72
+
73
+ ```bash
74
+ scale workspace status --summary
75
+ scale workspace finish --summary
76
+ scale workspace finish --json
77
+ ```
78
+
79
+ The report includes branch role, whether governed shipping is allowed, and cleanup blockers.
80
+
81
+ ## Worktree Lifecycle
82
+
83
+ Temporary agent worktrees are safe to remove only when all of these are true:
84
+
85
+ - root worktree is clean
86
+ - child repositories are clean and pushed when required
87
+ - the temporary branch has no unpushed commits
88
+ - a branch with no upstream is already merged into `dev`/`master`, or it contains no unique work
89
+
90
+ Cleanup remains dry-run by default:
91
+
92
+ ```bash
93
+ scale workspace cleanup --dir <temporary-worktree> --dry-run --json
94
+ scale workspace cleanup --dir <temporary-worktree> --apply --confirm <branch-or-head> --json
95
+ ```
96
+
97
+ If cleanup is blocked, push the branch, merge it, cherry-pick it into the selected release, or explicitly discard it before removing the worktree.
98
+
99
+ ## Repository Bootstrap
100
+
101
+ This repository currently treats `dev` as the integration branch and `master` as production. If `dev` falls behind `master` and has no unique commits, fast-forward `dev` to `master` before starting new feature work:
102
+
103
+ ```bash
104
+ git fetch --all --prune
105
+ git switch dev
106
+ git merge --ff-only master
107
+ git push origin dev
108
+ git push github dev
109
+ ```
110
+
111
+ After that, normal work should start from `dev`:
112
+
113
+ ```bash
114
+ git switch dev
115
+ git pull --ff-only origin dev
116
+ git switch -c feat/<short-name>
117
+ ```
118
+
119
+ Before creating a normal release from `dev`, inspect the release delta:
120
+
121
+ ```bash
122
+ git log --oneline master..dev
123
+ ```
124
+
125
+ If every listed commit is intended for the next production release, merge `dev` through the normal release path. If any commit must be excluded, create `release/vX.Y.Z` from `master` and cherry-pick only the approved release list.
package/docs/README.md CHANGED
@@ -28,6 +28,7 @@
28
28
  | [UPGRADE_MANAGEMENT.md](UPGRADE_MANAGEMENT.md) | SCALE CLI、governance pack、skills、MCP 和 CLI 工具的安全升级流程 |
29
29
  | [GOVERNANCE_DASHBOARD.md](GOVERNANCE_DASHBOARD.md) | Runtime、eval、memory、resource、HTML artifact 的统一治理面板 |
30
30
  | [RELEASE_READINESS.md](RELEASE_READINESS.md) | 发版前质量门槛、官方 demo 和真实项目落地验收 |
31
+ | [GITLAB_FLOW.md](GITLAB_FLOW.md) | GitLab Flow 分支、发版、tag 和临时 worktree 生命周期规范 |
31
32
  | [SKILL-REPOSITORY.md](SKILL-REPOSITORY.md) | 受治理 skill repository 和安装安全策略 |
32
33
  | [VIBE-TEMPLATES.md](VIBE-TEMPLATES.md) | 可复制的 Vibe Coding 提示词模板 |
33
34
  | [LEADERSHIP-PRESETS.md](LEADERSHIP-PRESETS.md) | CEO、CTO、PM、Architect 等内置领导者角色预设 |
@@ -0,0 +1,92 @@
1
+ # Resource Governance
2
+
3
+ SCALE now treats project outputs as governed resources instead of undifferentiated files.
4
+
5
+ ## Problem
6
+
7
+ Engineering agents generate many useful but noisy assets:
8
+
9
+ - maintained product and architecture docs
10
+ - task plans and verification notes
11
+ - E2E reports, screenshots, videos, logs, and coverage output
12
+ - temporary scripts and scratch files
13
+ - reusable automation scripts
14
+ - API contracts and ADRs
15
+
16
+ Without lifecycle rules these files drift, conflict with the real codebase, or get committed to Git when they should be local evidence only.
17
+
18
+ ## Model
19
+
20
+ `scale assets scan` classifies resources into:
21
+
22
+ | Type | Default Git policy | Lifecycle |
23
+ | --- | --- | --- |
24
+ | canonical-doc | commit | maintained |
25
+ | decision-record | commit | immutable |
26
+ | contract | commit | maintained |
27
+ | reusable-script | commit | maintained |
28
+ | task-artifact | review | task-scoped |
29
+ | evidence-report | ignore | generated |
30
+ | generated-media | review/external | generated or review-required |
31
+ | temporary | ignore | temporary |
32
+
33
+ `.scale/resource-policy.json` owns defaults such as owners, module mapping, runtime directories, and maximum Git file size.
34
+
35
+ `.scale/assets.json` is the explicit catalog for long-lived project assets and source-of-truth declarations.
36
+ Declared source-of-truth assets are checked by `assets doctor`; if the file disappears, the doctor fails. Maintained assets can also declare `lastReviewedAt` and `reviewIntervalDays` so product, architecture, workflow, and standards documents are rechecked against the current implementation instead of drifting silently:
37
+
38
+ ```json
39
+ {
40
+ "assets": [
41
+ {
42
+ "path": "docs/modules/auth/architecture.md",
43
+ "type": "canonical-doc",
44
+ "owner": "auth-team",
45
+ "module": "auth",
46
+ "sourceOfTruth": true,
47
+ "lifecycle": "maintained",
48
+ "gitPolicy": "commit",
49
+ "lastReviewedAt": "2026-05-15",
50
+ "reviewIntervalDays": 90
51
+ }
52
+ ]
53
+ }
54
+ ```
55
+
56
+ ## Commands
57
+
58
+ ```bash
59
+ scale assets scan --json
60
+ scale assets doctor --json
61
+ scale assets settle --task-id <task-id> --artifact-dir .planning/tasks/<task>
62
+ scale init --governance-pack resource-governance
63
+ ```
64
+
65
+ `assets doctor` fails when runtime evidence or external media is already tracked by Git, or when a declared source-of-truth asset is missing. It warns on large tracked files, expired temporary outputs, ownerless canonical documentation, missing non-source catalog entries, and stale maintained assets.
66
+
67
+ `assets settle` runs the same checks and appends a settlement section to `resource-impact.md` when a task artifact directory is provided.
68
+
69
+ ## Finish Rule
70
+
71
+ Before finishing M/L/CRITICAL work:
72
+
73
+ 1. Promote final product, API, or architecture truth into maintained docs.
74
+ 2. Keep task-scoped planning, runtime contracts, reality checks, cleanup notes, raw reports, logs, screenshots, videos, and scratch scripts out of long-lived `docs/` unless deliberately promoted.
75
+ 3. Run `scale assets scan --json`.
76
+ 4. Run `scale assets doctor --json`.
77
+ 5. Run `scale assets settle --task-id <task-id> --artifact-dir <task-dir>`.
78
+ 6. Delete or archive temporary resources that are no longer needed.
79
+
80
+ ## Task Artifact Boundary
81
+
82
+ New SCALE task artifacts default to `.planning/tasks/<task>/`, not `docs/worklog/tasks/<task>/`.
83
+
84
+ Every M/L/CRITICAL task should keep these three evidence files alongside the normal explore/plan/verification/review/summary set:
85
+
86
+ | File | Purpose |
87
+ | --- | --- |
88
+ | `runtime.md` | Records configuration source, topology, auth mode, and verification boundary. |
89
+ | `reality-check.md` | Separates confirmed behavior from not verified, stub/partial, credential-gated, and environment-gated claims. |
90
+ | `resource-cleanup.md` | Records which outputs stay task-scoped, which are promoted, and which should be deleted or archived. |
91
+
92
+ `docs/worklog/tasks/` remains a legacy-recognized task-artifact location for existing projects, but generated guidance now points new work to `.planning/tasks/`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hongmaple0820/scale-engine",
3
- "version": "0.21.0",
3
+ "version": "0.21.2",
4
4
  "description": "Executable AI agent governance with workflow gates, evidence, skill/tool orchestration, and traceable HTML artifacts",
5
5
  "type": "module",
6
6
  "bin": {
@@ -23,8 +23,10 @@
23
23
  "docs/SKILL_RADAR.md",
24
24
  "docs/MEMORY_BRAIN.md",
25
25
  "docs/GOVERNANCE_DASHBOARD.md",
26
+ "docs/GITLAB_FLOW.md",
26
27
  "docs/MEMORY_FABRIC.md",
27
28
  "docs/RUNTIME_EVIDENCE.md",
29
+ "docs/RESOURCE_GOVERNANCE.md",
28
30
  "docs/start",
29
31
  "examples/demo-projects/agent-governance-demo"
30
32
  ],