Index  Decision Records ADR-184: Concise Console Progress Output

ADR-184: Concise Console Progress Output

1 Status

Date Status
31-05-2026 Proposed
31-05-2026 Accepted
31-05-2026 In-Progress
04-06-2026 Implemented

2 Context

Running almirah please <project> printed one block of output per processed document. Each Specification emitted its title plus a four-row statistics table (Number of Controlled Items, Items w/ Up-links, Items w/ Down-links, …); every Index, Traceability, Coverage, Implementation, Decision, DecisionsOverview, and SourceFile printed its own coloured line via a to_console method. In addition, the SourceFile constructor carried a stray puts @specifications_path debug statement that printed an internal relative path for every source file discovered in a linked repository.

The result was console output whose volume scaled with the size of the project and with the number of files in any linked source repository. On a real project the actual outcome — did it finish, where is the output, were there problems — was buried under hundreds of per-document lines. A clean, fixed-size summary is far easier for a human to scan and far cheaper for an agent to read.

The detailed per-specification statistics that the verbose output carried are not lost: they are already rendered on the HTML index page (the requirements behind them, SRS-005 through SRS-008, are satisfied by the index, not by the console). So the console dump was largely redundant with the generated HTML.

3 Decision

Introduce a dedicated ConsoleReporter module and replace the verbose per-document console dump with a single concise progress summary keyed by pipeline phase.

3.1 ConsoleReporter

A new lib/almirah/console_reporter.rb defines a small stateless module:

3.2 Phase reporting in the pipeline

project.rb emits exactly one line per phase, at the end of that phase's method: parsing specifications ..... 4 ok
parsing test protocols ..... 2 ok
parsing decisions .......... 14 ok
traceability matrices ...... 4 ok
coverage matrices .......... 1 ok
implementation matrices .... 1 ok
decision links ............. 5 ok
rendering HTML ............. /build/index.html

link_all_decisions now tallies the number of decision→specification links it creates so it can report a meaningful count. A final report_rendered line is emitted at the end of both specifications_and_protocols and specifications_and_results (the --run variant), so the index path is always the last thing printed.

3.3 Index path normalization

The index path printed by report_rendered was assembled by interpolating the raw project-directory argument directly into "…/build/index.html". Because the argument is stored verbatim as the user typed it, the result depended on whether that argument carried a trailing slash: a literal separator before build doubled it for trailing-slash inputs (././/build, /a/b/c//a/b/c//build), while omitting the separator dropped it for no-trailing-slash inputs (Almirah.DocAlmirah.Docbuild). No single literal handled both forms.

This is resolved in two places:

3.4 Suppressing the verbose output

The five per-document doc.to_console invocations in the render methods (render_all_specifications, render_all_source_files, render_index, render_decisions_overview, render_all_decisions) are removed from the pipeline, and the stray puts @specifications_path debug line is removed from the SourceFile constructor. The to_console methods themselves are left defined on the document types; they are simply no longer called during a build.

4 Scope

Item Status Start Date Target Date Description
Requirements Done 31-05-2026 01-06-2026 New SRS items (SRS-079 onward) covering: a concise per-phase progress summary on standard output; the generated index path as the final progress line; ANSI colour only on an interactive terminal; index-path normalisation (SRS-082) — relative ./build/index.html when the project directory is the current directory, absolute otherwise, free of duplicated or missing separators
Code Done 31-05-2026 01-06-2026 Added lib/almirah/console_reporter.rb; added ConsoleReporter.count calls to parse_all_specifications, parse_all_protocols, parse_decisions, link_all_specifications, link_all_protocols, link_all_decisions (now tallying links), and link_all_source_files; added report_rendered to both pipeline entry points; removed the five doc.to_console calls from the render methods; removed the debug puts @specifications_path from SourceFile; normalised the project directory once via File.expand_path in ProjectConfiguration#initialize; rewrote report_rendered to build the path with File.join and print it relative (./build/index.html) when the project directory is the current directory, absolute otherwise
Tests Done 31-05-2026 01-06-2026 End-to-end (aruba) assertions in spec/e2e/console_output_spec.rb that almirah please prints the phase summary lines (SRS-079) and the index path as the final line (SRS-080), that captured (non-TTY) output contains no ANSI escape codes (SRS-081), and that the index path is shown relative (./build/index.html) for current-directory inputs and absolute otherwise, with no duplicated or missing separators for trailing-/no-trailing-slash argument forms (SRS-082). Each example names the SRS item it covers

5 Out of Scope

6 Consequences

6.1 Positive

6.2 Negative

6.3 Neutral

7 Alternatives Considered

8 Software Versions

Software Version Category Software Version ID
Latest Released Version 0.4.0
Issue Found in Version n/a
Target Release Version 0.4.1

9 Affected Documents

# Proposed Text Req-ID
1 While processing a project, the software shall emit a concise progress summary to standard output consisting of one line per processing phase, each line pairing a phase label with the number of items processed in that phase. SRS-079
2 The software shall print the path of the generated index page as the final line of the progress summary. SRS-080
3 The software shall apply ANSI colour to its progress output only when standard output is an interactive terminal, and shall emit uncoloured text otherwise. SRS-081
4 When composing the generated index path for the progress summary, the software shall resolve the project directory argument to a normalised path free of duplicated or missing path separators, regardless of the form of the argument. The path shall be shown relative to the current directory as "./build/index.html" when the project directory resolves to the current working directory, and as an absolute path otherwise. SRS-082

10 References

11 Review Evidences