process-dedup-review
Use this skill when the input is grouped JSON listing suspected duplicate process rows, especially groups generated from identical exchange fingerprints.
Workflow
- Create an output directory such as
artifacts/<case_slug>/.
- Freeze the grouped JSON input under
inputs/.
- Run the bundled wrapper:
node process-dedup-review/scripts/run-process-dedup-review.mjs \
--input /abs/path/duplicate-groups.json \
--out-dir /abs/path/artifacts/<case_slug> \
--json
- Read
outputs/duplicate-groups.json and outputs/delete-plan.json.
- Apply the decision rules in
references/review-rules.md.
- Write the review report and required summary/verification reports, and explicitly note any unresolved limitations in the review artifacts.
The wrapper delegates to the canonical CLI command:
tiangong-lca process dedup-review --input /abs/path/duplicate-groups.json --out-dir /abs/path/artifacts/<case_slug>
Canonical Input Contract
{
"source_label": "duplicate-processes-export",
"groups": [
{
"group_id": 1,
"processes": [
{
"process_id": "proc-1",
"version": "01.00.000",
"name_en": "Example process",
"name_zh": "示例过程",
"sheet_exchange_rows": [
{
"flow_id": "flow-1",
"direction": "Input",
"mean_amount": "1",
"resulting_amount": "1"
}
]
}
]
}
]
}
If the source begins as a spreadsheet, convert it into grouped JSON before using this skill. The skill no longer ships a workbook parser, because the default form must remain a thin CLI wrapper.
Remote Enrichment
- If
TIANGONG_LCA_API_BASE_URL, TIANGONG_LCA_SUPABASE_PUBLISHABLE_KEY, and TIANGONG_LCA_OAUTH_CLIENT_ID are available, run tiangong-lca auth status --json; the CLI then enriches each candidate with:
state_code
created_at
modified_at
- remote exchange flow short descriptions
- reference scan results within the authenticated user's accessible scope across
processes and lifecyclemodels
- The CLI loads
.env from the current working directory before reading TIANGONG_LCA_*.
- If status is
login-required, stop and ask the human to run auth login in a trusted terminal. Never request a password, code, token, or legacy API key. Use a separate private session file per account; headless tokens may come only from an approved orchestrator and never enter argv or artifacts.
- If remote enrichment fails, continue with local grouped-JSON evidence and note the limitation in the review output.
Canonical Outputs
inputs/dedup-input.manifest.json
inputs/processes.remote-metadata.json when remote enrichment succeeds
outputs/duplicate-groups.json
outputs/delete-plan.json
Decision Boundary
- Treat a group as an exact duplicate only when the normalized exchange multiset is identical after ignoring exchange row order and exchange internal IDs.
- Keep/delete is a review recommendation, not an automatic remote delete.
- If you cannot verify downstream references, label the delete list as
priority delete candidates rather than claiming the rows are globally safe to remove.
- If the upstream identity workflow returned
block_duplicate, preserve that decision as the reason to reuse an existing row instead of creating another process.
- If any group requires semantic judgment beyond exact exchange equality, mark it
manual_review in the handoff and stop autonomous delete planning for that group.
- Do not convert
delete-plan.json into remote mutation without a separate CLI-backed write command, dry-run artifact, and post-write verification.
Required Handoff Artifacts
- Input artifact: grouped duplicate-process JSON.
- CLI output artifacts:
inputs/dedup-input.manifest.json, optional inputs/processes.remote-metadata.json, outputs/duplicate-groups.json, and outputs/delete-plan.json.
- Review output: a concise report that states exact duplicate evidence, chosen keeper, reference-verification coverage, and whether each delete candidate is safe or only prioritized for manual review.
Load On Demand
- Read
references/review-rules.md for the evidence hierarchy and keep/delete tie-break rules.
1---2name: process-dedup-review3description: Review grouped TianGong process duplicate candidates from JSON snapshots, recommend which duplicate rows to keep or delete, and write reproducible evidence outputs plus follow-up notes. Use when identical exchange fingerprints suggest duplicate process drafts and you need a repeatable process dedup review workflow.4---56# process-dedup-review78Use this skill when the input is grouped JSON listing suspected duplicate `process` rows, especially groups generated from identical exchange fingerprints.910## Workflow11121. Create an output directory such as `artifacts/<case_slug>/`.132. Freeze the grouped JSON input under `inputs/`.143. Run the bundled wrapper:1516```bash17node process-dedup-review/scripts/run-process-dedup-review.mjs \18 --input /abs/path/duplicate-groups.json \19 --out-dir /abs/path/artifacts/<case_slug> \20 --json21```22234. Read `outputs/duplicate-groups.json` and `outputs/delete-plan.json`.245. Apply the decision rules in `references/review-rules.md`.256. Write the review report and required summary/verification reports, and explicitly note any unresolved limitations in the review artifacts.2627The wrapper delegates to the canonical CLI command:2829```bash30tiangong-lca process dedup-review --input /abs/path/duplicate-groups.json --out-dir /abs/path/artifacts/<case_slug>31```3233## Canonical Input Contract3435```json36{37 "source_label": "duplicate-processes-export",38 "groups": [39 {40 "group_id": 1,41 "processes": [42 {43 "process_id": "proc-1",44 "version": "01.00.000",45 "name_en": "Example process",46 "name_zh": "示例过程",47 "sheet_exchange_rows": [48 {49 "flow_id": "flow-1",50 "direction": "Input",51 "mean_amount": "1",52 "resulting_amount": "1"53 }54 ]55 }56 ]57 }58 ]59}60```6162If the source begins as a spreadsheet, convert it into grouped JSON before using this skill. The skill no longer ships a workbook parser, because the default form must remain a thin CLI wrapper.6364## Remote Enrichment6566- If `TIANGONG_LCA_API_BASE_URL`, `TIANGONG_LCA_SUPABASE_PUBLISHABLE_KEY`, and `TIANGONG_LCA_OAUTH_CLIENT_ID` are available, run `tiangong-lca auth status --json`; the CLI then enriches each candidate with:67 - `state_code`68 - `created_at`69 - `modified_at`70 - remote exchange flow short descriptions71 - reference scan results within the authenticated user's accessible scope across `processes` and `lifecyclemodels`72- The CLI loads `.env` from the current working directory before reading `TIANGONG_LCA_*`.73- If status is `login-required`, stop and ask the human to run `auth login` in a trusted terminal. Never request a password, code, token, or legacy API key. Use a separate private session file per account; headless tokens may come only from an approved orchestrator and never enter argv or artifacts.74- If remote enrichment fails, continue with local grouped-JSON evidence and note the limitation in the review output.7576## Canonical Outputs7778- `inputs/dedup-input.manifest.json`79- `inputs/processes.remote-metadata.json` when remote enrichment succeeds80- `outputs/duplicate-groups.json`81- `outputs/delete-plan.json`8283## Decision Boundary8485- Treat a group as an exact duplicate only when the normalized exchange multiset is identical after ignoring exchange row order and exchange internal IDs.86- Keep/delete is a review recommendation, not an automatic remote delete.87- If you cannot verify downstream references, label the delete list as `priority delete candidates` rather than claiming the rows are globally safe to remove.88- If the upstream identity workflow returned `block_duplicate`, preserve that decision as the reason to reuse an existing row instead of creating another process.89- If any group requires semantic judgment beyond exact exchange equality, mark it `manual_review` in the handoff and stop autonomous delete planning for that group.90- Do not convert `delete-plan.json` into remote mutation without a separate CLI-backed write command, dry-run artifact, and post-write verification.9192## Required Handoff Artifacts9394- Input artifact: grouped duplicate-process JSON.95- CLI output artifacts: `inputs/dedup-input.manifest.json`, optional `inputs/processes.remote-metadata.json`, `outputs/duplicate-groups.json`, and `outputs/delete-plan.json`.96- Review output: a concise report that states exact duplicate evidence, chosen keeper, reference-verification coverage, and whether each delete candidate is safe or only prioritized for manual review.9798## Load On Demand99100- Read `references/review-rules.md` for the evidence hierarchy and keep/delete tie-break rules.