@refactorlabs/recount 0.7.0 → 0.7.1

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/dist/index.d.cts CHANGED
@@ -227,7 +227,6 @@ type SpanOptions = {
227
227
  };
228
228
  type IngestPayload = {
229
229
  name: string;
230
- input?: JsonObject;
231
230
  environment?: string;
232
231
  metadata?: Metadata;
233
232
  durationMs?: number;
@@ -235,7 +234,6 @@ type IngestPayload = {
235
234
  spans: Span[];
236
235
  };
237
236
  type TraceOptions = {
238
- input?: JsonObject;
239
237
  environment?: string;
240
238
  metadata?: Metadata;
241
239
  retentionPeriod?: RetentionPeriod;
package/dist/index.d.ts CHANGED
@@ -227,7 +227,6 @@ type SpanOptions = {
227
227
  };
228
228
  type IngestPayload = {
229
229
  name: string;
230
- input?: JsonObject;
231
230
  environment?: string;
232
231
  metadata?: Metadata;
233
232
  durationMs?: number;
@@ -235,7 +234,6 @@ type IngestPayload = {
235
234
  spans: Span[];
236
235
  };
237
236
  type TraceOptions = {
238
- input?: JsonObject;
239
237
  environment?: string;
240
238
  metadata?: Metadata;
241
239
  retentionPeriod?: RetentionPeriod;
package/llms.md CHANGED
@@ -20,7 +20,7 @@ If no API key is found, the SDK disables itself. All calls become no-ops with no
20
20
  await recount.startTrace(name, options?, async () => { ... });
21
21
  ```
22
22
 
23
- Options: `input: JsonObject`, `metadata: Record<string, string|number|boolean|null>`, `environment: string`, `retentionPeriod: '1d'|'7d'|'30d'|'90d'|'1y'` (default `'30d'`)
23
+ Options: `metadata: Record<string, string|number|boolean|null>`, `environment: string`, `retentionPeriod: '1d'|'7d'|'30d'|'90d'|'1y'` (default `'30d'`)
24
24
 
25
25
  The trace is sent when the callback resolves or throws.
26
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refactorlabs/recount",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Node.js SDK for Recount",
5
5
  "homepage": "https://recount.refactor.gg",
6
6
  "license": "MIT",
@@ -103,10 +103,10 @@ For each one:
103
103
 
104
104
  1. **Wrap the entry point** in `recount.startTrace(name, options, async () => { ... })`. The trace
105
105
  name should read like a ticket title (`Loan eligibility - ${applicationId}`), not a function
106
- name. Put identifying context in `metadata` and a summary in `input`. If the decision is
107
- regulated or long-lived (compliance, audit, dispute resolution), consider setting
108
- `retentionPeriod` (`'1d' | '7d' | '30d' | '90d' | '1y'`, default `'30d'`) - don't set it for
109
- routine/low-stakes traces, the default is fine.
106
+ name. Put identifying context in `metadata`. If the decision is regulated or long-lived
107
+ (compliance, audit, dispute resolution), consider setting `retentionPeriod`
108
+ (`'1d' | '7d' | '30d' | '90d' | '1y'`, default `'30d'`) - don't set it for routine/low-stakes
109
+ traces, the default is fine.
110
110
 
111
111
  2. **Decompose the function's real steps into named spans** - don't wrap the whole body in one
112
112
  span. Read the function and find its natural stages (a lookup, a calculation, a rule check, a
@@ -147,8 +147,12 @@ For each one:
147
147
 
148
148
  5. **Add alerts on real thresholds already present in the code** (a `>=650` credit score check, a
149
149
  `>40%` DTI cutoff) - don't invent thresholds that aren't already business rules in the
150
- function. `alerts` take `gt`/`lt` against a `checks[].value`, optionally matched to a table
151
- `target`.
150
+ function. Alerts are imperative: wrap the existing `if` that already checks the threshold and
151
+ call `recount.addAlert(label, level, opts?)` inside it - the SDK does no comparison itself,
152
+ you decide `level` (`'warn' | 'error'`). The alert attaches to whichever span was most recently
153
+ added. `opts.checks` is optional display context (`target` names the field, `value` is the
154
+ number), not something the SDK evaluates. Inside `addGroup`, use `g.alert(label, level, opts?)`
155
+ instead.
152
156
 
153
157
  6. **Redact PII fields you flagged in Step 2** - either `recount.REDACTED` inline, or
154
158
  `redact: [...]` on the span/table, or `redactParams` for db spans. Never trace a raw SSN, full