From a13894a38af449c06704ff8c8343b9e66202cfaa Mon Sep 17 00:00:00 2001 From: Dave Oster Date: Tue, 13 Oct 2026 13:46:45 -0500 Subject: [PATCH 1/2] Name the CLI as the source on the login credential check (FW-1829) (#32) * Name the CLI as the source on the login credential check The check reads the account with the saved key, so it is logged like any other request. Without the header the API counts it as plain API use. Co-Authored-By: Claude Opus 5.5 * Map the CLI source check to its test (FW-1829) Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- src/lib/api.ts | 2 ++ tests/factory/FW-1829.json | 29 +++++++++++++++++++++++++++++ tests/lib/api.test.ts | 1 + 3 files changed, 32 insertions(+) create mode 100644 tests/factory/FW-1829.json diff --git a/src/lib/api.ts b/src/lib/api.ts index 461a8f6..68f359b 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -141,6 +141,8 @@ export async function verifyCredentials(apiKey: string): Promise<{ headers: { 'Authorization': `Bearer ${apiKey}`, 'User-Agent': CLI_USER_AGENT, + // Counts this check as CLI use in the API's request log. + 'X-DealMachine-Source': 'cli', }, }); diff --git a/tests/factory/FW-1829.json b/tests/factory/FW-1829.json new file mode 100644 index 0000000..c3f21b6 --- /dev/null +++ b/tests/factory/FW-1829.json @@ -0,0 +1,29 @@ +{ + "version": 1, + "issue": "FW-1829", + "criteria": [ + { + "id": "AC-1", + "text": "GIVEN a person uses the CLI with an API key, WHEN they sign in with that key or ask the CLI to verify who they are signed in as, THEN the request that checks the key tells the API it came from the CLI, so it is counted as CLI use and not as plain API use." + } + ], + "checks": [ + { + "title": "CLI key check tells the API it came from the CLI", + "surface": "cli", + "repository": "cli", + "preconditions": [ + "Run the reviewed CLI candidate with the approved Factory executor. No API credentials are needed." + ], + "steps": [ + "Run the CLI check suite. The CLI API helpers test in tests/lib/api.test.ts checks a key and inspects the request that was sent." + ], + "expected": "The request that checks a key carries the CLI source marker alongside the key and the CLI version, so the API counts it as CLI use.", + "criterionId": "AC-1", + "execution": "automated", + "automation": { + "taskId": "cli:check" + } + } + ] +} diff --git a/tests/lib/api.test.ts b/tests/lib/api.test.ts index a5d21a2..60b641d 100644 --- a/tests/lib/api.test.ts +++ b/tests/lib/api.test.ts @@ -37,6 +37,7 @@ describe('CLI API helpers', () => { headers: { 'Authorization': 'Bearer dm_sk_live_test', 'User-Agent': `dm-cli/${manifest.version}`, + 'X-DealMachine-Source': 'cli', }, }); }); From 1cb62075febcb848f1506d53e436932579bb148c Mon Sep 17 00:00:00 2001 From: Dave Oster Date: Tue, 13 Oct 2026 16:08:47 -0500 Subject: [PATCH 2/2] Prepare CLI 0.4.1 artifact for source attribution fix --- npm-alias/package.json | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- src/version.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/npm-alias/package.json b/npm-alias/package.json index 9acfaa7..9151826 100644 --- a/npm-alias/package.json +++ b/npm-alias/package.json @@ -1,6 +1,6 @@ { "name": "dealmachine", - "version": "0.4.1-rc.2", + "version": "0.4.1", "description": "Short install alias for the DealMachine property intelligence CLI", "author": "DealMachine", "license": "MIT", @@ -23,7 +23,7 @@ "LICENSE" ], "dependencies": { - "@dealmachine/cli": "0.4.1-rc.2" + "@dealmachine/cli": "0.4.1" }, "engines": { "node": ">=18" diff --git a/package-lock.json b/package-lock.json index c4223ee..a38dde4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dealmachine/cli", - "version": "0.4.1-rc.2", + "version": "0.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dealmachine/cli", - "version": "0.4.1-rc.2", + "version": "0.4.1", "license": "MIT", "dependencies": { "chalk": "^5.3.0", diff --git a/package.json b/package.json index f230193..b5777d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dealmachine/cli", - "version": "0.4.1-rc.2", + "version": "0.4.1", "description": "DealMachine CLI for property intelligence, people lookup, and enrichment through the public API", "author": "DealMachine", "license": "MIT", diff --git a/src/version.ts b/src/version.ts index d4bb406..c6f8f26 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,2 +1,2 @@ -export const CLI_VERSION = '0.4.1-rc.2'; +export const CLI_VERSION = '0.4.1'; export const CLI_USER_AGENT = `dm-cli/${CLI_VERSION}`;