@@ -19,15 +19,15 @@ Use `moonbitlang/async/os_error` for `isatty` failures instead of a local
1919- ` isatty ` changes from raising ` TtyError ` to raising ` @os_error.OSError ` .
2020- The local ` TtyError ` type is removed from the root interface.
2121- Add the public ` Fd ` trait used by generic ` isatty ` .
22- - Add ` Fd ` impls for ` @ async/types.Fd ` , ` @async/fs.File ` ,
22+ - Add ` Fd ` impls for concrete async I/O handles: ` @async/fs.File ` ,
2323 ` @async/pipe.PipeRead ` , ` @async/pipe.PipeWrite ` , ` @async/stdio.Input ` , and
24- ` @async/stdio.Output ` .
24+ ` @async/stdio.Output ` . Raw ` @async/types.Fd ` is intentionally not a
25+ supported public input.
2526
2627## Acceptance
2728
2829- ` isatty ` returns ` true ` for terminal handles.
2930- ` isatty ` returns ` false ` for valid non-terminal handles.
30- - Invalid fds raise ` @os_error.OSError ` .
3131- ` .mbti ` contains only the intended ` isatty ` and ` Fd ` surface changes.
3232
3333## Validation
@@ -46,12 +46,10 @@ Use `moonbitlang/async/os_error` for `isatty` failures instead of a local
4646- Removed the root ` TtyError ` error type.
4747- Kept non-terminal handles as ` false ` and invalid fd failures as OS errors.
4848- Kept the fd-like generic shape by adding a public ` Fd ` trait and impls for
49- the async fd-bearing handle types already supported by root reader/writer
49+ the concrete async I/O handle types already supported by root reader/writer
5050 traits.
5151- Made ` Reader ` and ` Writer ` inherit ` Fd ` so fd-bearing constraints have one
5252 source of truth.
53- - Updated the invalid fd white-box test to assert the ` isatty ` OS error
54- context.
5553- Updated tests and the ` examples/isatty ` demo to pass stdio handles directly.
5654
5755## Public API Audit
@@ -60,8 +58,9 @@ Use `moonbitlang/async/os_error` for `isatty` failures instead of a local
6058 ` Bool raise @os_error.OSError ` .
6159- Root ` .mbti ` removes ` TtyError ` .
6260- Root ` .mbti ` adds only the intended ` Fd ` trait and impls for
63- ` @async/types.Fd ` , ` @async/fs.File ` , ` @async/pipe.PipeRead ` ,
64- ` @async/pipe.PipeWrite ` , ` @async/stdio.Input ` , and ` @async/stdio.Output ` .
61+ ` @async/fs.File ` , ` @async/pipe.PipeRead ` , ` @async/pipe.PipeWrite ` ,
62+ ` @async/stdio.Input ` , and ` @async/stdio.Output ` ; it does not expose raw
63+ ` @async/types.Fd ` as an accepted ` isatty ` input.
6564- Root ` .mbti ` changes ` Reader ` and ` Writer ` to inherit ` Fd ` instead of
6665 repeating their own ` fd ` method.
6766- No parser state, terminal handle storage, platform resize behavior, or VT
@@ -76,3 +75,11 @@ Use `moonbitlang/async/os_error` for `isatty` failures instead of a local
7675- ` moon info `
7776- generated ` .mbti ` diff reviewed
7877- ` git diff --check `
78+
79+ ## Follow-up CI Adjustment
80+
81+ - Removed the raw ` @async/types.Fd ` impl from the public ` Fd ` surface. Unix
82+ aliases that type to ` Int ` , but Windows keeps it opaque, so accepting the raw
83+ type leaks platform handle details into ` isatty ` .
84+ - Removed the ` isatty(-1) ` white-box test because invalid integer fd behavior is
85+ Unix-specific and not part of the cross-platform public contract.
0 commit comments