-
Notifications
You must be signed in to change notification settings - Fork 9
Peel: three-layer progressive-disclosure output system #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c8f25aa
peel L1: display-neutral view model (PeelView, statuses, attention co…
JohnnyWilson16 9fda5e2
peel L2: CleanReport normalizer and plain-language vocabulary
JohnnyWilson16 547e593
peel L3: display options and plain-text reference renderer
JohnnyWilson16 da2b7dc
peel L4: show(mode=, renderer=) and fd.set_display
JohnnyWilson16 32a5bad
peel L5: styled terminal renderer with optional rich
JohnnyWilson16 d637c67
peel L6: Peel notebook HTML renderer (opt-in)
JohnnyWilson16 5586f67
peel L7: surface semantic evidence in the Peel view
JohnnyWilson16 76df5f5
peel L8: ParseResult display with stage ladder and PARTIAL honesty
JohnnyWilson16 b657804
peel L9: CopilotReport display with privacy-over-trust invariant
JohnnyWilson16 fc377df
peel L10: additive Peel display flags on 'freshdata clean'
JohnnyWilson16 e8014d2
peel L11: document the Peel output system
JohnnyWilson16 3f50fcd
peel: guard rich-dependent terminal tests with importorskip
JohnnyWilson16 bdc5a05
Merge remote-tracking branch 'origin/main' into feature/peel-output-jwd
JohnnyWilson16 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| --- | ||
| title: Peel — the output system | ||
| description: >- | ||
| Peel is freshdata's progressive-disclosure output system: a glance-level | ||
| answer, an inspect layer of evidence, and a full audit layer with zero | ||
| information loss, shared across the core API, semantic models, the AI | ||
| copilot, and parsing. | ||
| keywords: freshdata output, progressive disclosure, clean report, terminal rendering, notebook html, machine readable | ||
| --- | ||
|
|
||
| # Peel — the output system | ||
|
|
||
| Peel is how freshdata report objects present themselves. A result is fresh | ||
| produce: the **skin** tells you at a glance whether it is good, you can **peel** | ||
| to the flesh to inspect it, and the **core** is always intact. | ||
|
|
||
| Every report — `CleanReport`, `ParseResult`, the experimental `CopilotReport` — | ||
| renders through the same three layers: | ||
|
|
||
| | Layer | Name | What it answers | | ||
| |---|---|---| | ||
| | 1 | **Skin** (glance) | Did it succeed? What changed? Does anything need my attention? What's the one next step? | | ||
| | 2 | **Flesh** (inspect) | The evidence — per-column changes, ranked findings, semantic proposals, frame inventory. | | ||
| | 3 | **Core** (audit) | Every field, machine-readable, nothing dropped. | | ||
|
|
||
| Peel never removes information; it only decides what you see first. Layer 3 is | ||
| the existing structured objects and their `to_dict()`/`to_json()` — display can | ||
| be turned off entirely and no data is lost. | ||
|
|
||
| ## Status and severity language | ||
|
|
||
| Every result carries a **text status label** (colour and icons only reinforce | ||
| it, so output stays readable when piped, in CI, or for screen readers): | ||
|
|
||
| `CLEAN` · `CHANGED` · `REVIEW` · `BLOCKED` · `PARTIAL` · `SKIPPED` · `FAILED` | ||
|
|
||
| Findings in the attention list are ranked by one shared order: | ||
|
|
||
| 1. privacy & safety → 2. data-corruption risk → 3. policy/contract → 4. analysis | ||
| reliability → 5. cosmetic consistency | ||
|
|
||
| so a high trust score can never bury a privacy or policy finding. | ||
|
|
||
| ## Seeing Peel output | ||
|
|
||
| Peel is **opt-in** while it stabilizes; existing output is unchanged by default. | ||
|
|
||
| ```python | ||
| import freshdata as fd | ||
|
|
||
| cleaned, report = fd.clean(df, return_report=True) | ||
|
|
||
| report.show() # legacy behavior unchanged (inline HTML / temp file) | ||
| report.show(mode="standard") # Peel text: glance + attention + next step | ||
| report.show(mode="compact") # two lines, for pipelines | ||
| report.show(mode="verbose") # + per-column, semantic, and action detail | ||
| report.show(renderer="terminal") # styled panel when `rich` is installed | ||
| ``` | ||
|
|
||
| ### Display modes | ||
|
|
||
| | Mode | Use | | ||
| |---|---| | ||
| | `auto` | environment-aware: `standard` in a terminal, `compact` when piped | | ||
| | `compact` | one-screen, two lines | | ||
| | `standard` | glance + ranked attention + next step | | ||
| | `verbose` | full human-readable diagnostics | | ||
| | `debug` | + internal audit metadata | | ||
| | `json` | stable `to_dict()` on stdout | | ||
| | `plain` | no ANSI, ASCII icons | | ||
| | `silent` | render nothing | | ||
|
|
||
| ### Notebook | ||
|
|
||
| `fd.set_display("peel")` (or `FRESHDATA_DISPLAY=peel`) switches the notebook | ||
| `_repr_html_` to the Peel card; `FRESHDATA_LEGACY_DISPLAY=1` forces the legacy | ||
| layout. Objects with only a Peel view (like `ParseResult`) always render as Peel. | ||
| Disclosure uses native `<details>`, so it works in static notebook exports with | ||
| no JavaScript. | ||
|
|
||
| ### Command line | ||
|
|
||
| `freshdata clean` gains additive display flags; default output is unchanged: | ||
|
|
||
| ```bash | ||
| freshdata clean input.csv # unchanged (legacy summary) | ||
| freshdata clean input.csv --verbose # Peel verbose | ||
| freshdata clean input.csv -vv # Peel debug | ||
| freshdata clean input.csv --output-format json # report JSON to stdout | ||
| freshdata clean input.csv --no-color # no ANSI | ||
| freshdata clean input.csv --display peel # Peel standard | ||
| ``` | ||
|
|
||
| Display flags never change cleaning behavior. `fd.set_display(...)` sets | ||
| process-wide preferences; `NO_COLOR` and `FRESHDATA_NO_PREVIEWS` are honored. | ||
|
|
||
| ## Machine-readable access is unchanged | ||
|
|
||
| `report.to_dict()` / `report.to_json()` schemas are frozen — additive only. | ||
| `report.actions`, `report.warnings`, `report.domain_findings`, `report.attention` | ||
| (the ranked queue) and every other attribute keep working. Peel is a rendering | ||
| layer over these objects, never a replacement for them. | ||
|
|
||
| ## Privacy | ||
|
|
||
| Values shown on evidence cards and previews are escaped before HTML rendering | ||
| and never placed in HTML attributes. `fd.set_display(previews=False)` (or | ||
| `FRESHDATA_NO_PREVIEWS=1`) switches to schema-only display. `undo_log` is never | ||
| serialized, and provider credentials are never captured — only failure states | ||
| appear in the audit layer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.