Skip to content

Latest commit

 

History

History
103 lines (79 loc) · 2.83 KB

File metadata and controls

103 lines (79 loc) · 2.83 KB

Frequency (listFrequencyNode)

Category: Lists

Intended behavior

Groups identical entries and counts them, ordered most-used first. Report is a ready-to-display 'item: count' block.

Inputs

ID Label Type Unwired default
list List any []
enabled Enabled boolean true

Outputs

ID Label Type Default
values Values any undefined
counts Counts any undefined
report Report string undefined
unique Unique number undefined

Configuration defaults

{
  "caseSensitive": false,
  "minCount": 1,
  "topN": 0
}

Observed frontend behavior

This calls the production passive computation with the declared input/config defaults. Cached state, trigger execution and project wiring are separate.

{
  "kind": "passive-default-probe",
  "outputs": {
    "values": [],
    "counts": [],
    "report": "",
    "unique": 0
  }
}

Observed backend behavior

Offline production passive computation with the same declared defaults; no device or model service is invoked.

{
  "kind": "passive-default-probe",
  "outputs": {
    "values": [],
    "counts": [],
    "report": "",
    "unique": 0
  }
}

Current frontend implementation

Extracted production branches; helper calls and project execution context are defined in the referenced modules.

src/lib/list-node-compute.ts:97

listFrequencyNode: (inputs, config) => {
    const list = toList(inputs.list);
    const caseSensitive = config.caseSensitive ?? false;
    const all = tally(list, caseSensitive);
    const minCount = Math.trunc(toNum(config.minCount, 1));
    let kept = all.filter((t) => t.count >= minCount);
    const topN = Math.trunc(toNum(config.topN, 0));
    if (topN > 0) kept = kept.slice(0, topN);
    return {
      values: kept.map((t) => t.value),
      counts: kept.map((t) => t.count),
      report: kept.map((t) => `${toStr(t.value)}: ${t.count}`).join("\n"),
      // Distinct entries in the whole input — deliberately not the filtered
      // length, so "top 5 of 300 unique words" is still expressible.
      unique: all.length,
    };
  }

Implementation references

Verification limits

  • Default passive probe is an observation, not proof of all configurations, trigger behavior, or correctness. See ../NODE_RUNTIME_AUDIT.md and ../AUDIT_VALIDATION.md for test evidence.
  • Enabled=false uses the runtime bypass mapping; bypass output can differ from the normal declared output type.

Source fingerprint: 7e9d192bd3a559a7c50253919867601ef02c311d61e859f7afb4cadcfa508430. Rebuild with npm run docs:index.