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
4 changes: 4 additions & 0 deletions apps/ui/src/features/operate/live-debug/DebugLal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ const popoutComparable = ref<
>([]);
const popoutDslLines = ref<string[]>([]);
const popoutCurrentLine = ref<number>(0);
const popoutReason = ref<string | null>(null);

/** Brace-match a top-level DSL block (`extractor {` … `}`) and return its
* 1-based line span, or null when the opener isn't present. */
Expand Down Expand Up @@ -467,6 +468,7 @@ function openCellPopout(cell: LalCellData, step: LalStep, node: LalNodeView): vo
popoutJson.value = fullJson(cell.payload, step.type);
popoutDslLines.value = sourceDslLines.value;
popoutCurrentLine.value = stepLines(step).start;
popoutReason.value = cell.sample.reason ?? null;
// Comparable = the record's other same-format (builder) cells. Per-
// statement snapshots map to their DSL line; the post-extractor /
// output snapshots map to their whole block range, so the captured
Expand Down Expand Up @@ -970,6 +972,7 @@ function recordTitle(view: LalRecordView): string {
<LalCell
:step-type="step.type"
:payload="cellAt(node, step, rv.recIdx)?.payload ?? null"
:reason="cellAt(node, step, rv.recIdx)?.sample.reason ?? null"
/>
</template>
</div>
Expand All @@ -985,6 +988,7 @@ function recordTitle(view: LalRecordView): string {
:title="popoutTitle"
:script="popoutScript"
:json="popoutJson"
:reason="popoutReason"
:comparable="popoutComparable"
:dsl-lines="popoutDslLines"
:current-line="popoutCurrentLine"
Expand Down
32 changes: 32 additions & 0 deletions apps/ui/src/features/operate/live-debug/LalCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ import {
const props = defineProps<{
stepType: SampleType;
payload: LalSamplePayload | null;
/** Why this step stopped the pipeline (parse failure, non-matching regexp, …),
* or null/undefined when it continued or the OAP version doesn't report it. */
reason?: string | null;
/** When set (the cell popout), body/content shows its complete pretty-
* printed value instead of the 80-char dense-matrix preview. */
full?: boolean;
Expand Down Expand Up @@ -119,6 +122,10 @@ const outputKvs = computed(() => outputEntries(props.payload, props.full));
</div>
</template>
<div v-if="props.payload?.aborted" class="lal__abort">{{ t('aborted') }}</div>
<div v-if="props.reason" class="lal__reason">
<span class="lal__reasonlabel">{{ t('drop reason') }}</span>
<span class="lal__reasontext">{{ props.reason }}</span>
</div>
</template>

<style scoped>
Expand Down Expand Up @@ -229,4 +236,29 @@ const outputKvs = computed(() => outputEntries(props.payload, props.full));
text-transform: uppercase;
letter-spacing: var(--sw-ls-caps);
}

.lal__reason {
display: flex;
flex-direction: column;
gap: 2px;
border-left: 2px solid var(--rr-warn, #d6a96d);
padding-left: 6px;
}

.lal__reasonlabel {
color: var(--rr-warn, #d6a96d);
font-size: var(--sw-fs-xs);
font-weight: var(--sw-fw-bold);
text-transform: uppercase;
letter-spacing: var(--sw-ls-caps);
}

.lal__reasontext {
color: var(--rr-ink2);
font-family: var(--rr-font-mono);
font-size: var(--sw-fs-xs);
line-height: 1.4;
word-break: break-all;
white-space: pre-wrap;
}
</style>
32 changes: 32 additions & 0 deletions apps/ui/src/features/operate/live-debug/LalCellPopout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const props = defineProps<{
script: string;
/** The opened cell's complete payload, pretty JSON. */
json: string;
/** Why this step stopped the pipeline, or null when it continued. */
reason?: string | null;
/** Same-format sibling cells. `lineStart..lineEnd` is the DSL span
* (equal for per-statement steps, the block range for block steps). */
comparable: { label: string; script: string; json: string; lineStart: number; lineEnd: number }[];
Expand Down Expand Up @@ -114,6 +116,11 @@ function clearCompare(): void {
<div class="lpop">
<pre v-if="script" class="lpop__script">{{ script }}</pre>

<div v-if="reason" class="lpop__reason">
<span class="lpop__reasonlabel">{{ t('drop reason') }}</span>
<span class="lpop__reasontext">{{ reason }}</span>
</div>

<div v-if="comparable.length > 0" class="lpop__bar">
<span class="lpop__lbl">{{ t('compare with') }}</span>
<button
Expand Down Expand Up @@ -217,6 +224,31 @@ function clearCompare(): void {
flex-shrink: 0;
}

.lpop__reason {
display: flex;
flex-direction: column;
gap: 3px;
padding: 6px 9px;
border-left: 2px solid var(--rr-warn, #d6a96d);
background: var(--rr-bg);
flex-shrink: 0;
}
.lpop__reasonlabel {
color: var(--rr-warn, #d6a96d);
font-size: var(--sw-fs-xs);
font-weight: var(--sw-fw-bold);
text-transform: uppercase;
letter-spacing: var(--sw-ls-caps);
}
.lpop__reasontext {
color: var(--rr-ink);
font-family: var(--rr-font-mono);
font-size: var(--sw-fs-sm);
line-height: 1.5;
white-space: pre-wrap;
word-break: break-word;
}

.lpop__bar {
display: flex;
align-items: center;
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@
"carried": "carried",
"+ added": "+ added",
"aborted": "aborted",
"drop reason": "drop reason",
"file": "file",
"select an .oal file…": "select an .oal file…",
"metric": "metric",
Expand Down
1 change: 1 addition & 0 deletions apps/ui/src/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
"carried": "继承",
"+ added": "+ 新增",
"aborted": "已中止",
"drop reason": "丢弃原因",
"file": "文件",
"select an .oal file…": "选择一个 .oal 文件…",
"metric": "指标",
Expand Down
8 changes: 7 additions & 1 deletion packages/api-client/src/dsl-debugging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,13 +432,19 @@ export type SamplePayload =
* - `payload`: per-DSL shape — see the per-DSL types above.
* - `sourceLine`: 1-based line number in the rule body. Omitted when
* 0 / not applicable (block-level LAL probes, MAL chain stages on
* a one-liner rule). */
* a one-liner rule).
* - `reason`: human-readable explanation of WHY this step stopped the
* pipeline (a parse exception, a non-matching regexp, an input-type
* mismatch), paired with `continueOn: false`. Optional — LAL-only
* today, and absent from OAP versions before it was added, so the
* UI must treat its absence as "no reason available". */
export interface SessionSample {
type: SampleType;
sourceText: string;
continueOn: boolean;
payload: SamplePayload;
sourceLine?: number;
reason?: string;
}

/** Catalog-specific structured rule metadata. The recorder fills in
Expand Down
Loading