Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/pipeline/nodes/laneView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* These are pure functions over validated governed results. They contain no
* vendor logic, no I/O, and no scoring: the scorer-visible values they carry
* (technical.emaDistancePct / isInValueSweetSpot / brokeEmaWithBody=false,
* (technical.emaDistancePct / isInValueSweetSpot / brokeEmaWithBody stub,
* pattern.patternName / patternConfidence, sentiment.tags) are projected
* byte-identically to the pre-activation runtime. The view ADDITIONALLY
* carries projected-but-unread lane context (technical.atr14 / trendBias,
Expand All @@ -16,7 +16,10 @@
* change view shape, never scored values — reading any of them in the adapter
* is a separately governed change.
*/
import type { FroggyEnrichedView } from "afi-core/analysts/froggy.enrichment_adapter.js";
import {
BROKE_EMA_WITH_BODY_UNIMPLEMENTED_STUB,
type FroggyEnrichedView,
} from "afi-core/analysts/froggy.enrichment_adapter.js";
import type { TechnicalLensV1 } from "../../types/UssLenses.js";

/** Governed sentiment axis observation (afi.enrichment.sentiment.v1 item). */
Expand Down Expand Up @@ -60,7 +63,8 @@ export interface AiMlLanePayload {

/**
* technical governed result → view.technical (BYTE-IDENTICAL to the
* pre-activation merge mapping: brokeEmaWithBody pinned false, same renames).
* pre-activation merge mapping: brokeEmaWithBody pinned to the declared
* unimplemented stub, same renames).
*/
export function viewTechnical(
payload: TechnicalLensV1["payload"] | null | undefined
Expand All @@ -69,7 +73,10 @@ export function viewTechnical(
return {
emaDistancePct: payload.emaDistancePct,
isInValueSweetSpot: payload.isInValueSweetSpot,
brokeEmaWithBody: false,
// D5 / D5-GOV zero-movement: explicit unimplemented-input stub — NOT a
// computed candle fact. See BROKE_EMA_WITH_BODY_UNIMPLEMENTED_STUB in
// afi-core/analysts/froggy.enrichment_adapter.ts.
brokeEmaWithBody: BROKE_EMA_WITH_BODY_UNIMPLEMENTED_STUB,
indicators: {
rsi: payload.rsi14,
ema_20: payload.ema20,
Expand Down
2 changes: 1 addition & 1 deletion src/pipeline/nodes/mergeEnrichedView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* news, aiMl) into the analyst-facing FroggyEnrichedView + USS lenses +
* _priceFeedMetadata. The scorer-visible values are projected through the
* shared laneView helpers BYTE-IDENTICALLY to the pre-activation runtime
* (technical emaDistancePct / isInValueSweetSpot / brokeEmaWithBody=false and
* (technical emaDistancePct / isInValueSweetSpot / brokeEmaWithBody stub and
* indicator renames; pattern patternName / patternConfidence from the
* candlestick block; sentiment tags from the closed axis-tag vocabulary), so
* analyst scoring, UWR, and the ScoredSignal projection are unchanged.
Expand Down
8 changes: 6 additions & 2 deletions test/providers/fiveLaneAdapters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -831,12 +831,16 @@ describe("FLPR-GOV — laneView projections + inertness", () => {
}
});

it("viewTechnical pins brokeEmaWithBody=false, preserves the scorer-visible renames, and projects the unread context fields", () => {
it("viewTechnical pins brokeEmaWithBody to the declared unimplemented stub, preserves scorer-visible renames, and projects unread context", () => {
const { BROKE_EMA_WITH_BODY_UNIMPLEMENTED_STUB } = require("afi-core/analysts/froggy.enrichment_adapter.js") as {
BROKE_EMA_WITH_BODY_UNIMPLEMENTED_STUB: false;
};
expect(BROKE_EMA_WITH_BODY_UNIMPLEMENTED_STUB).toBe(false);
const view = viewTechnical({ emaDistancePct: 1.2, isInValueSweetSpot: true, rsi14: 55, ema20: 100, ema50: 98, volumeRatio: 1.1, atr14: 42.5, trendBias: "bullish" } as never)!;
expect(view).toEqual({
emaDistancePct: 1.2,
isInValueSweetSpot: true,
brokeEmaWithBody: false,
brokeEmaWithBody: BROKE_EMA_WITH_BODY_UNIMPLEMENTED_STUB,
indicators: { rsi: 55, ema_20: 100, ema_50: 98, volume_ratio: 1.1 },
atr14: 42.5,
trendBias: "bullish",
Expand Down
Loading