Skip to content

Commit 21d9d8a

Browse files
committed
Reconstruct curs_attr (attributes) to 100%
Extend the Window cell model to carry display attributes (Cell { ch, attr }), matching ncurses' public A_* bit values (BOLD=0x200000, UNDERLINE=0x20000, ...). attron/attroff/attrset/attr_get, standout/standend, and chgat (change n cells' attributes without moving the cursor) are reconstructed; addch applies the current attribute to written cells. New oracle court NCURSES.WINDOW.ATTR: scripts attron/attrset/chgat + addstr and reads each cell's char+attribute back via winch & A_ATTRIBUTES -- 5 scripts, admitted_match. Parity: curs_attr 27/27 now 100% (attron/attroff/attrset/attr_get, chgat, standout/standend and their w-/attr_* variants partial; vidattr/vidputs scaffold byte producers). Colour-pair bits are an explicit non-claim. Nineteen groups fully resolved. Overall 268/481 (55.7%): 175 reconstructed (32 full, 116 partial, 23 scaffold, 4 divergent) + 93 classified (28 deferred, 65 n/a). 49 tests; gate green.
1 parent 768d07f commit 21d9d8a

10 files changed

Lines changed: 607 additions & 203 deletions

File tree

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,19 @@ clang C inventory joined with the `syn`-extracted Rust inventory and a curated,
3636
validated counterpart map). `cargo xtask check` is the freshness gate -- it
3737
re-renders in memory and fails if a doc drifted, a counterpart points at a
3838
missing Rust symbol, or a cited court has no receipt. CI and the optional
39-
`.githooks/pre-commit` run it on every change. Measured coverage today: **249 /
40-
481 functions (51.8%)** resolved. Read that honestly as two parts:
39+
`.githooks/pre-commit` run it on every change. Measured coverage today: **268 /
40+
481 functions (55.7%)** resolved. Read that honestly as two parts:
4141

42-
- **156 reconstructed** (32 full, 93 partial, 27 scaffold, 4 divergent) -- actual
43-
Rust that emits/derives bytes or reconstructs window state/geometry, court-backed.
42+
- **175 reconstructed** (32 full, 116 partial, 23 scaffold, 4 divergent) -- actual
43+
Rust that emits/derives bytes or reconstructs window state/geometry/attributes,
44+
court-backed.
4445
- **93 classified non-output** (28 deferred = proven to emit nothing, 65 n/a = no
4546
terminal-output contract: pure queries, tty/termios state, library config,
4647
printer, window-free, or global `cur_term` management).
4748

48-
So ~32% of the API is *reconstructed* and the rest of the "resolved" total is
49+
So ~36% of the API is *reconstructed* and the rest of the "resolved" total is
4950
honest accounting of functions a byte-output reconstruction has nothing to emit
50-
for. **Eighteen groups are fully resolved (100%)** -- the ones with real
51+
for. **Nineteen groups are fully resolved (100%)** -- the ones with real
5152
reconstruction:
5253

5354
- **Terminfo & termcap** (`curs_terminfo`/termcap, 33/33) -- the substrate: the
@@ -78,6 +79,9 @@ reconstruction:
7879
`dupwin`/`derwin`/`subwin` and the `getbegyx`/`getmaxyx`/`getparyx` geometry
7980
getters, matched to ncurses by a geometry court (shared-cell child windows not
8081
modelled; `delwin`/`wgetparent` n/a in the owned-value model).
82+
- **Attributes** (`curs_attr`, 27/27) -- `attron`/`attroff`/`attrset`/`chgat`/
83+
`standout` carried on the cell grid, matched to ncurses' `A_*` bits via `winch`
84+
(`vidattr`/`vidputs` are scaffold byte producers; colour-pair bits out of scope).
8185
- **Terminal queries** (`curs_termattrs`, 17/17) -- `longname`/`termname`/
8286
`has_ic`/`has_il` reconstructed from terminfo and matched across 9 terminals;
8387
`termattrs`/`baudrate`/`erasechar`/`killchar`/`curses_version` are screen/tty/

docs-src/models/parity.model.json

Lines changed: 192 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,44 +2522,68 @@
25222522
"note": "No pair table; the fg/bg SGR bytes a pair would activate are produced directly."
25232523
},
25242524
"attron": {
2525-
"rust": "attr::sgr_on",
2526-
"status": "scaffold",
2527-
"note": "Emits a set_attributes-style composite; not pinned to a standalone attribute court yet."
2525+
"rust": "window::Window::attron",
2526+
"status": "partial",
2527+
"courts": [
2528+
"NCURSES.WINDOW.ATTR"
2529+
],
2530+
"note": "Turns attribute bits on for subsequent writes; cell attributes matched to ncurses A_* via winch."
25282531
},
25292532
"attroff": {
2530-
"rust": "attr::sgr_off",
2531-
"status": "scaffold",
2532-
"note": "Emits the sgr0 + default-restore composite; no attribute-state stacking."
2533+
"rust": "window::Window::attroff",
2534+
"status": "partial",
2535+
"courts": [
2536+
"NCURSES.WINDOW.ATTR"
2537+
],
2538+
"note": "Turns attribute bits off; cell attributes matched to ncurses via winch."
25332539
},
25342540
"attrset": {
2535-
"rust": "attr::sgr_on",
2536-
"status": "scaffold",
2537-
"note": "Byte stand-in; no attribute state."
2541+
"rust": "window::Window::attrset",
2542+
"status": "partial",
2543+
"courts": [
2544+
"NCURSES.WINDOW.ATTR"
2545+
],
2546+
"note": "Sets the active attributes; cell attributes matched to ncurses via winch."
25382547
},
25392548
"wattron": {
2540-
"rust": "attr::sgr_on",
2541-
"status": "scaffold",
2542-
"note": "Same byte producer; no WINDOW model."
2549+
"rust": "window::Window::attron",
2550+
"status": "partial",
2551+
"courts": [
2552+
"NCURSES.WINDOW.ATTR"
2553+
],
2554+
"note": "Turns attribute bits on for subsequent writes; cell attributes matched to ncurses A_* via winch."
25432555
},
25442556
"wattroff": {
2545-
"rust": "attr::sgr_off",
2546-
"status": "scaffold",
2547-
"note": "Same byte producer; no WINDOW model."
2557+
"rust": "window::Window::attroff",
2558+
"status": "partial",
2559+
"courts": [
2560+
"NCURSES.WINDOW.ATTR"
2561+
],
2562+
"note": "Turns attribute bits off; cell attributes matched to ncurses via winch."
25482563
},
25492564
"wattrset": {
2550-
"rust": "attr::sgr_on",
2551-
"status": "scaffold",
2552-
"note": "Same byte producer; no WINDOW model."
2565+
"rust": "window::Window::attrset",
2566+
"status": "partial",
2567+
"courts": [
2568+
"NCURSES.WINDOW.ATTR"
2569+
],
2570+
"note": "Sets the active attributes; cell attributes matched to ncurses via winch."
25532571
},
25542572
"standout": {
2555-
"rust": "attr::sgr_on",
2556-
"status": "scaffold",
2557-
"note": "Stand-in for the standout rendition."
2573+
"rust": "window::Window::standout",
2574+
"status": "partial",
2575+
"courts": [
2576+
"NCURSES.WINDOW.ATTR"
2577+
],
2578+
"note": "Turns on A_STANDOUT; matched via winch."
25582579
},
25592580
"standend": {
2560-
"rust": "attr::sgr_off",
2561-
"status": "scaffold",
2562-
"note": "Stand-in for rendition reset."
2581+
"rust": "window::Window::standend",
2582+
"status": "partial",
2583+
"courts": [
2584+
"NCURSES.WINDOW.ATTR"
2585+
],
2586+
"note": "Turns all attributes off; matched via winch."
25632587
},
25642588
"doupdate": {
25652589
"rust": "screen::single_field_repaint",
@@ -3481,6 +3505,150 @@
34813505
"NCURSES.WINDOW.GEOMETRY"
34823506
],
34833507
"note": "Position relative to the parent window; matched by the geometry court."
3508+
},
3509+
"attr_on": {
3510+
"rust": "window::Window::attron",
3511+
"status": "partial",
3512+
"courts": [
3513+
"NCURSES.WINDOW.ATTR"
3514+
],
3515+
"note": "Turns attribute bits on for subsequent writes; cell attributes matched to ncurses A_* via winch."
3516+
},
3517+
"wattr_on": {
3518+
"rust": "window::Window::attron",
3519+
"status": "partial",
3520+
"courts": [
3521+
"NCURSES.WINDOW.ATTR"
3522+
],
3523+
"note": "Turns attribute bits on for subsequent writes; cell attributes matched to ncurses A_* via winch."
3524+
},
3525+
"attr_off": {
3526+
"rust": "window::Window::attroff",
3527+
"status": "partial",
3528+
"courts": [
3529+
"NCURSES.WINDOW.ATTR"
3530+
],
3531+
"note": "Turns attribute bits off; cell attributes matched to ncurses via winch."
3532+
},
3533+
"wattr_off": {
3534+
"rust": "window::Window::attroff",
3535+
"status": "partial",
3536+
"courts": [
3537+
"NCURSES.WINDOW.ATTR"
3538+
],
3539+
"note": "Turns attribute bits off; cell attributes matched to ncurses via winch."
3540+
},
3541+
"attr_set": {
3542+
"rust": "window::Window::attrset",
3543+
"status": "partial",
3544+
"courts": [
3545+
"NCURSES.WINDOW.ATTR"
3546+
],
3547+
"note": "Sets the active attributes; cell attributes matched to ncurses via winch."
3548+
},
3549+
"wattr_set": {
3550+
"rust": "window::Window::attrset",
3551+
"status": "partial",
3552+
"courts": [
3553+
"NCURSES.WINDOW.ATTR"
3554+
],
3555+
"note": "Sets the active attributes; cell attributes matched to ncurses via winch."
3556+
},
3557+
"attr_get": {
3558+
"rust": "window::Window::attr_get",
3559+
"status": "partial",
3560+
"courts": [
3561+
"NCURSES.WINDOW.ATTR"
3562+
],
3563+
"note": "Returns the active attributes."
3564+
},
3565+
"wattr_get": {
3566+
"rust": "window::Window::attr_get",
3567+
"status": "partial",
3568+
"courts": [
3569+
"NCURSES.WINDOW.ATTR"
3570+
],
3571+
"note": "Returns the active attributes."
3572+
},
3573+
"getattrs": {
3574+
"rust": "window::Window::attr_get",
3575+
"status": "partial",
3576+
"courts": [
3577+
"NCURSES.WINDOW.ATTR"
3578+
],
3579+
"note": "Returns the active attributes."
3580+
},
3581+
"chgat": {
3582+
"rust": "window::Window::chgat",
3583+
"status": "partial",
3584+
"courts": [
3585+
"NCURSES.WINDOW.ATTR"
3586+
],
3587+
"note": "Changes the attributes of n cells at the cursor (chars unchanged); matched to ncurses via winch."
3588+
},
3589+
"wchgat": {
3590+
"rust": "window::Window::chgat",
3591+
"status": "partial",
3592+
"courts": [
3593+
"NCURSES.WINDOW.ATTR"
3594+
],
3595+
"note": "Changes the attributes of n cells at the cursor (chars unchanged); matched to ncurses via winch."
3596+
},
3597+
"mvchgat": {
3598+
"rust": "window::Window::chgat",
3599+
"status": "partial",
3600+
"courts": [
3601+
"NCURSES.WINDOW.ATTR"
3602+
],
3603+
"note": "Changes the attributes of n cells at the cursor (chars unchanged); matched to ncurses via winch."
3604+
},
3605+
"mvwchgat": {
3606+
"rust": "window::Window::chgat",
3607+
"status": "partial",
3608+
"courts": [
3609+
"NCURSES.WINDOW.ATTR"
3610+
],
3611+
"note": "Changes the attributes of n cells at the cursor (chars unchanged); matched to ncurses via winch."
3612+
},
3613+
"wstandout": {
3614+
"rust": "window::Window::standout",
3615+
"status": "partial",
3616+
"courts": [
3617+
"NCURSES.WINDOW.ATTR"
3618+
],
3619+
"note": "Turns on A_STANDOUT; matched via winch."
3620+
},
3621+
"wstandend": {
3622+
"rust": "window::Window::standend",
3623+
"status": "partial",
3624+
"courts": [
3625+
"NCURSES.WINDOW.ATTR"
3626+
],
3627+
"note": "Turns all attributes off; matched via winch."
3628+
},
3629+
"vidattr": {
3630+
"rust": "attr::sgr_on",
3631+
"status": "scaffold",
3632+
"courts": [],
3633+
"note": "Emits the terminfo set_attributes byte sequence for an attribute; a byte stand-in, not separately courted."
3634+
},
3635+
"vidattr_sp": {
3636+
"rust": "attr::sgr_on",
3637+
"status": "scaffold",
3638+
"courts": [],
3639+
"note": "Emits the terminfo set_attributes byte sequence for an attribute; a byte stand-in, not separately courted."
3640+
},
3641+
"vidputs": {
3642+
"rust": "attr::sgr_on",
3643+
"status": "scaffold",
3644+
"courts": [],
3645+
"note": "Emits the terminfo set_attributes byte sequence for an attribute; a byte stand-in, not separately courted."
3646+
},
3647+
"vidputs_sp": {
3648+
"rust": "attr::sgr_on",
3649+
"status": "scaffold",
3650+
"courts": [],
3651+
"note": "Emits the terminfo set_attributes byte sequence for an attribute; a byte stand-in, not separately courted."
34843652
}
34853653
}
34863654
}

docs/generated/claim-index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ join, and `cargo xtask check` fails if any cited receipt is missing.
3737
| `NCURSES.TOUCH.NOOUTPUT` | admitted_match | `syncok`, `touchline`, `touchwin`, `untouchwin`, `wcursyncup`, `wsyncdown`, `wsyncup`, `wtouchln` |
3838
| `NCURSES.TPARM` | admitted_match | `tiparm`, `tiparm_s`, `tparm`, `tparm_sp` |
3939
| `NCURSES.TPUTS` | admitted_match | `putp`, `putp_sp`, `tputs`, `tputs_sp` |
40+
| `NCURSES.WINDOW.ATTR` | admitted_match | `attr_get`, `attr_off`, `attr_on`, `attr_set`, `attroff`, `attron`, `attrset`, `chgat`, `getattrs`, `mvchgat`, `mvwchgat`, `standend`, `standout`, `wattr_get`, `wattr_off`, `wattr_on`, `wattr_set`, `wattroff`, `wattron`, `wattrset`, `wchgat`, `wstandend`, `wstandout` |
4041
| `NCURSES.WINDOW.GEOMETRY` | admitted_match | `derwin`, `dupwin`, `getbegx`, `getbegy`, `getcurx`, `getcury`, `getmaxx`, `getmaxy`, `getparx`, `getpary`, `is_subwin`, `mvderwin`, `mvwin`, `newwin`, `newwin_sp`, `subwin`, `wresize` |
4142
| `NCURSES.WINDOW.STATE` | admitted_match | `addch`, `addnstr`, `addstr`, `border`, `box`, `delch`, `deleteln`, `echochar`, `erase`, `hline`, `inch`, `inchnstr`, `inchstr`, `innstr`, `insch`, `insdelln`, `insertln`, `insnstr`, `insstr`, `instr`, `move`, `mvaddch`, `mvaddnstr`, `mvaddstr`, `mvdelch`, `mvhline`, `mvinch`, `mvinchnstr`, `mvinchstr`, `mvinnstr`, `mvinsch`, `mvinsnstr`, `mvinsstr`, `mvinstr`, `mvvline`, `mvwaddch`, `mvwaddnstr`, `mvwaddstr`, `mvwdelch`, `mvwhline`, `mvwinch`, `mvwinchnstr`, `mvwinchstr`, `mvwinnstr`, `mvwinsch`, `mvwinsnstr`, `mvwinsstr`, `mvwinstr`, `mvwvline`, `vline`, `waddch`, `waddnstr`, `waddstr`, `wborder`, `wdelch`, `wdeleteln`, `wechochar`, `werase`, `whline`, `winch`, `winchnstr`, `winchstr`, `winnstr`, `winsch`, `winsdelln`, `winsertln`, `winsnstr`, `winsstr`, `winstr`, `wmove`, `wvline` |
4243

0 commit comments

Comments
 (0)