NAME

Developer::Dashboard::Runtime::Result - helper accessors for dashboard hook RESULT JSON

SYNOPSIS

use Developer::Dashboard::Runtime::Result;

my $all    = Developer::Dashboard::Runtime::Result::current();
my $mode   = Developer::Dashboard::Runtime::Result::set_current($all);
my $stdout = Developer::Dashboard::Runtime::Result::stdout('00-first.pl');
my $last   = Developer::Dashboard::Runtime::Result::last_entry();
Developer::Dashboard::Runtime::Result::clear_current();

DESCRIPTION

This module decodes the hook-result payload populated by dashboard command hook execution. Small payloads stay inline in RESULT. Oversized payloads spill into RESULT_FILE before later exec() calls would hit the kernel arg/env limit. The helper accessors hide that transport detail and provide one consistent way to read per-hook stdout, stderr, and exit codes from Perl hook scripts.

FUNCTIONS

current, set_current, clear_current, names, has, entry, stdout, stderr, exit_code, last_name, last_entry, report

Decode, write, clear, and report the current hook-result payload, whether it is stored inline in RESULT or spilled into RESULT_FILE.

PURPOSE

This module manages the structured RESULT state passed between command hooks and their final command target. It serializes hook stdout, stderr, and exit codes, decodes that state for later hooks, and transparently spills oversized payloads into RESULT_FILE when the environment would become too large.

WHY IT EXISTS

It exists because hook chaining needs a transport format that is explicit and portable. Encoding that state in one module keeps hook readers and writers synchronized and avoids argument-list failures when a long hook chain produces too much output for ENV{RESULT} alone.

WHEN TO USE

Use this file when changing hook result serialization, RESULT versus RESULT_FILE overflow rules, or the reporting helpers used by command-hook scripts.

HOW TO USE

Use set_current, clear_current, and the decode/report helpers rather than manipulating ENV{RESULT} by hand. Hook scripts should read structured state through this module instead of parsing JSON blobs themselves.

WHAT USES IT

It is used by bin/dashboard command-hook priming, update hooks, skill hook dispatch, and tests that cover RESULT overflow and chained hook behavior.

EXAMPLES

Example 1:

perl -Ilib -MDeveloper::Dashboard::Runtime::Result -e 1

Do a direct compile-and-load check against the module from a source checkout.

Example 2:

prove -lv t/21-refactor-coverage.t t/00-load.t

Run the focused regression tests that most directly exercise this module's behavior.

Example 3:

HARNESS_PERL_SWITCHES=-MDevel::Cover prove -lr t

Recheck the module under the repository coverage gate rather than relying on a load-only probe.

Example 4:

prove -lr t

Put any module-level change back through the entire repository suite before release.