Skip to content

Commit 11a8732

Browse files
mpstatonclaude
andcommitted
feat(crm-starter-export): --include for operator-directed org rows; person-anchored deals resolve via org aliases
Two operator rulings from the triage pass land as mechanism: --include <slugs>: canonical orgs appended to the pipeline-scoped export as their own rows (enrichment filled, pipeline columns blank, pipeline_matched 'manual'). First use: raise-us — the org behind the person-anchored "Blair Miller" deal row. Person-anchored deal rows resolve by aliasing the org with the person's name forms — "Judy Dimon"/"Judith Dimon" now alias james-and-judith-k-dimon-foundation (via resolver.update_org, so the export needs no special case and every future run matches). Same pattern the todd-fisher alias on jed-foundation pioneered. Run: 97 org rows (75 matched + raise-us manual), 20-row sidecar, 76 people incl. Blair Miller → raise-us and Judith Dimon → the Dimon foundation. Files changed: - scripts/export-crm-orgs-csv.mjs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RW28dw3kQAKXr2ZNefCukE
1 parent d417e2a commit 11a8732

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

scripts/export-crm-orgs-csv.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ for (let i = 2; i < process.argv.length; i += 1) {
4747
// row — the tracker's shape, enriched. Multi-deal orgs stay multi-row.
4848
// 'all': one row per canonical org (the event-based long tail included).
4949
else if (k === '--scope') args.scope = process.argv[++i];
50+
// Operator-directed additions: canonical org slugs appended as rows even
51+
// though no pipeline row names them (pipeline_matched: 'manual'). First
52+
// use: raise-us — the org behind the person-anchored "Blair Miller" deal
53+
// row (operator ruling 2026-07-28, in lieu of a person-name org alias).
54+
else if (k === '--include') args.include = process.argv[++i].split(',').map((s) => s.trim()).filter(Boolean);
5055
}
5156
const today = new Date().toISOString().slice(0, 10);
5257
const OUT_DIR = resolve(args.outDir ?? `clients/${args.client}/outputs/${today}_crm-starter`);
@@ -275,6 +280,24 @@ if (args.scope === 'pipeline') {
275280
exported_at,
276281
}));
277282
unmatched = resolved.filter((r) => !r.slug).map((r) => r.row);
283+
// Operator-directed inclusions land after the pipeline rows.
284+
const already = new Set(outRows.map((r) => r.external_id).filter(Boolean));
285+
for (const slug of args.include ?? []) {
286+
if (already.has(slug)) continue;
287+
const o = orgBySlug.get(slug);
288+
if (!o) {
289+
console.warn(` ⚠ --include ${slug}: no canonical org with that slug — skipped`);
290+
continue;
291+
}
292+
outRows.push({
293+
...enrichmentFor(o),
294+
pipeline_org_name: '',
295+
pipeline_matched: 'manual',
296+
...Object.fromEntries(PIPELINE_COLS.map((c) => [c, ''])),
297+
exported_at,
298+
});
299+
console.log(` + included ${slug} (manual)`);
300+
}
278301
} else {
279302
// --scope all: one row per canonical org (first matching pipeline row
280303
// attached), the event-based long tail included.

0 commit comments

Comments
 (0)