Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7b746f7
WIP: Analyses Finding #9 — implement formatter ConfigPatch monoid (T-…
briansrls May 26, 2026
83c5455
T-4.16 follow-on: dissolve formatter-config-patch gate — add FieldPat…
briansrls May 26, 2026
92b04c5
prettier.dag: replace bespoke Prettier*Patch coproducts with FieldPat…
briansrls May 26, 2026
ff27e84
patch.dag: add compose_field_patch + field_patch_monoid<T> witness (M…
briansrls May 26, 2026
3957e39
prettier.dag: expand PrettierConfigPatch to per-field FieldPatch<T>
briansrls May 26, 2026
764924d
Merge remote-tracking branch 'origin/main' into session/vivid-wren-215
briansrls May 26, 2026
fec18cd
WIP: Analyses Finding #9 — implement formatter ConfigPatch monoid (T-…
briansrls May 26, 2026
3ac471c
patch.dag: correct grounding — right-biased optional-value monoid, no…
briansrls May 26, 2026
db7ef8c
WIP: Analyses Finding #9 — implement formatter ConfigPatch monoid (T-…
briansrls May 26, 2026
7878f59
field_patch_monoid.dag: remove hand-rolled field_patch_bool_eq (Pract…
briansrls May 27, 2026
bd6406a
field_patch_monoid.dag: fix parse error — data initializer must start…
briansrls May 27, 2026
7c36463
test: wire monoid witness consumer claims in field_patch_monoid.dag
briansrls May 27, 2026
6293218
Merge remote-tracking branch 'origin/main' into session/vivid-wren-215
briansrls May 27, 2026
d953a42
fix: remove explicit <Bool> type args from field_patch_monoid calls
briansrls May 27, 2026
446f592
WIP: PR #3705: add right-bias TestClaim to field_patch_monoid — opena…
briansrls May 27, 2026
9c119e5
WIP: PR #3705: add right-bias TestClaim to field_patch_monoid — opena…
briansrls May 27, 2026
dab5f93
Merge remote-tracking branch 'origin/main' into session/vivid-wren-215
briansrls May 27, 2026
bda19b9
WIP: PR #3705: add right-bias TestClaim to field_patch_monoid — opena…
briansrls May 27, 2026
1ef9eae
fix: gate ConfigPatch record mirrors under config-patch-record-projec…
briansrls May 27, 2026
99963cd
fix: clarify patch anchor and config-patch-record-projection owner
briansrls May 27, 2026
e5a3359
fix(T-4.16): align TASKS.md layering contract with ConfigPatch model
briansrls May 27, 2026
89eceda
fix(T-4.16): update TASKS.md pattern line for ConfigPatch layering
briansrls May 27, 2026
449ba0e
fix(prettier): align PrettierConfigPatch with PrettierConfig shape
briansrls May 27, 2026
716a8e7
WIP: Resolve merge conflict on PR #3705 (session/vivid-wren-215): mer…
briansrls May 28, 2026
4eac56f
fix: remove formatter conflict markers
briansrls May 28, 2026
6f6ab37
WIP: Resolve merge conflict on PR #3705 (session/vivid-wren-215): mer…
briansrls May 28, 2026
bf2c331
chore: no-op refresh to reset review cycle
briansrls May 28, 2026
f91285c
chore: no-op refresh (2) to reset review cycle
briansrls May 28, 2026
8464350
chore: add trailing newline to black.dag to refresh review cycle
briansrls May 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 42 additions & 5 deletions src/v4/extdeps/formatters/black.dag
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// src/v4/extdeps/formatters/black.dag
// Scope: Black 26.5.1 pyproject [tool.black] configuration model.
// Owns: BlackTargetVersion, BlackTargetVersionPolicy, BlackRequiredVersionPolicy, BlackUnstableFeature, BlackConfig, black_defaults, black_layer.
// Consumes: v4.std.collection { List }.
// Owns: BlackTargetVersion, BlackTargetVersionPolicy, BlackRequiredVersionPolicy, BlackUnstableFeature, BlackConfig, black_defaults, BlackConfigPatch, black_layer.
// Consumes: v4.std.collection { List }, v4.std.patch { FieldPatch, apply_field_patch }.
// Status: T-4.16 scaffold — Black 26.5.1 pyproject schema.
// Anchor: https://github.com/psf/black/blob/26.5.1/src/black/resources/black.schema.json

module v4.extdeps.formatters.black

import v4.std.collection { List }
import v4.std.patch { FieldPatch, apply_field_patch }


// 🟢 coproduct dissolution — CP-3229-GREEN-TERMINAL.
Expand Down Expand Up @@ -92,7 +93,43 @@ data black_defaults: BlackConfig = BlackConfig {
}


// 🟡 gated — feature: formatter-config-patch — bind T-4.16 follow-on — dissolve-on-arrival: BlackConfigPatch type with per-field Override<T>/Inherit arms replaces full-config layering; forbidden: full-config replacement where partial field override is needed.
fn black_layer(base: BlackConfig, outer: BlackConfig) -> BlackConfig {
outer
type BlackConfigPatch {
line_length: FieldPatch<Int>
target_version: FieldPatch<BlackTargetVersionPolicy>
required_version: FieldPatch<BlackRequiredVersionPolicy>
pyi: FieldPatch<Bool>
ipynb: FieldPatch<Bool>
python_cell_magics: FieldPatch<List<String>>
skip_source_first_line: FieldPatch<Bool>
skip_string_normalization: FieldPatch<Bool>
skip_magic_trailing_comma: FieldPatch<Bool>
preview: FieldPatch<Bool>
unstable: FieldPatch<Bool>
enable_unstable_feature: FieldPatch<List<BlackUnstableFeature>>
include: FieldPatch<String>
exclude: FieldPatch<String>
extend_exclude: FieldPatch<String>
force_exclude: FieldPatch<String>
}


fn black_layer(base: BlackConfig, patch: BlackConfigPatch) -> BlackConfig {
BlackConfig {
line_length: apply_field_patch(base: base.line_length, patch: patch.line_length),
target_version: apply_field_patch(base: base.target_version, patch: patch.target_version),
required_version: apply_field_patch(base: base.required_version, patch: patch.required_version),
pyi: apply_field_patch(base: base.pyi, patch: patch.pyi),
ipynb: apply_field_patch(base: base.ipynb, patch: patch.ipynb),
python_cell_magics: apply_field_patch(base: base.python_cell_magics, patch: patch.python_cell_magics),
skip_source_first_line: apply_field_patch(base: base.skip_source_first_line, patch: patch.skip_source_first_line),
skip_string_normalization: apply_field_patch(base: base.skip_string_normalization, patch: patch.skip_string_normalization),
skip_magic_trailing_comma: apply_field_patch(base: base.skip_magic_trailing_comma, patch: patch.skip_magic_trailing_comma),
preview: apply_field_patch(base: base.preview, patch: patch.preview),
unstable: apply_field_patch(base: base.unstable, patch: patch.unstable),
enable_unstable_feature: apply_field_patch(base: base.enable_unstable_feature, patch: patch.enable_unstable_feature),
include: apply_field_patch(base: base.include, patch: patch.include),
exclude: apply_field_patch(base: base.exclude, patch: patch.exclude),
extend_exclude: apply_field_patch(base: base.extend_exclude, patch: patch.extend_exclude),
force_exclude: apply_field_patch(base: base.force_exclude, patch: patch.force_exclude),
}
}
402 changes: 397 additions & 5 deletions src/v4/extdeps/formatters/clang_format.dag

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions src/v4/extdeps/formatters/gofmt.dag
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// src/v4/extdeps/formatters/gofmt.dag
// Scope: gofmt configuration carrier (no project config file; no configurable style options).
// Owns: GofmtConfig, gofmt_defaults, gofmt_layer.
// Owns: GofmtConfig, gofmt_defaults, GofmtConfigPatch, gofmt_layer.
// Consumes: none.
// Status: T-4.16 scaffold — gofmt doc.go (no style configuration surface).
// Anchor: https://go.dev/src/cmd/gofmt/doc.go
Expand All @@ -13,7 +13,9 @@ type GofmtConfig {}
data gofmt_defaults: GofmtConfig = GofmtConfig {}


// 🟡 gated — feature: formatter-config-patch — bind T-4.16 follow-on — dissolve-on-arrival: GofmtConfigPatch type with per-field Override<T>/Inherit arms replaces full-config layering; forbidden: full-config replacement where partial field override is needed.
fn gofmt_layer(base: GofmtConfig, outer: GofmtConfig) -> GofmtConfig {
outer
type GofmtConfigPatch {}


fn gofmt_layer(base: GofmtConfig, patch: GofmtConfigPatch) -> GofmtConfig {
base
}
18 changes: 13 additions & 5 deletions src/v4/extdeps/formatters/google_java_format.dag
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// src/v4/extdeps/formatters/google_java_format.dag
// Scope: google-java-format style selection model — no user-configurable algorithm options.
// Owns: GoogleJavaFormatStyle, GoogleJavaFormatConfig, google_java_format_defaults, google_java_format_layer.
// Consumes: none (String, Bool, Int, List are language-level primitives; no compiler dependency).
// Owns: GoogleJavaFormatStyle, GoogleJavaFormatConfig, google_java_format_defaults, GoogleJavaFormatConfigPatch, google_java_format_layer.
// Consumes: v4.std.patch { FieldPatch, apply_field_patch }.
// Status: T-4.16 scaffold — style toggle grounded in google-java-format README.
// Anchor: https://github.com/google/google-java-format

module v4.extdeps.formatters.google_java_format

import v4.std.patch { FieldPatch, apply_field_patch }


// 🟢 coproduct dissolution — CP-3229-GREEN-TERMINAL.
type GoogleJavaFormatStyle
Expand All @@ -24,7 +26,13 @@ data google_java_format_defaults: GoogleJavaFormatConfig = GoogleJavaFormatConfi
}


// 🟡 gated — feature: formatter-config-patch — bind T-4.16 follow-on — dissolve-on-arrival: GoogleJavaFormatConfigPatch type with per-field Override<T>/Inherit arms replaces full-config layering.
fn google_java_format_layer(base: GoogleJavaFormatConfig, outer: GoogleJavaFormatConfig) -> GoogleJavaFormatConfig {
outer
type GoogleJavaFormatConfigPatch {
style: FieldPatch<GoogleJavaFormatStyle>
}


fn google_java_format_layer(base: GoogleJavaFormatConfig, patch: GoogleJavaFormatConfigPatch) -> GoogleJavaFormatConfig {
GoogleJavaFormatConfig {
style: apply_field_patch(base: base.style, patch: patch.style),
}
}
53 changes: 48 additions & 5 deletions src/v4/extdeps/formatters/ktfmt.dag
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// src/v4/extdeps/formatters/ktfmt.dag
// Scope: ktfmt configuration model — option space grounded in ktfmt latest README/options and CLI help.
// Owns: KtfmtStyle, KtfmtTrailingCommaManagementStrategy, KtfmtPositiveInt, ktfmt_positive_int_validation, make_ktfmt_positive_int, KtfmtConfig, ktfmt_defaults, ktfmt_layer.
// Consumes: Locus, Outcome, Symbol, Refined, Validation.
// Owns: KtfmtStyle, KtfmtTrailingCommaManagementStrategy, KtfmtPositiveInt, ktfmt_positive_int_validation, make_ktfmt_positive_int, KtfmtConfig, ktfmt_defaults, KtfmtConfigPatch, ktfmt_layer.
// Consumes: Locus, Outcome, Symbol, Refined, Validation, FieldPatch, apply_field_patch.
// Status: T-4.16 scaffold — full documented ktfmt option surface.
// Anchor: https://github.com/facebook/ktfmt#options

Expand All @@ -11,6 +11,7 @@ module v4.extdeps.formatters.ktfmt
import v4.std.diagnostic { Locus, Outcome }
import v4.std.node { Symbol }
import v4.std.refinement { Refined, Validation, refine }
import v4.std.patch { FieldPatch, apply_field_patch }


// 🟢 coproduct dissolution — CP-3229-GREEN-TERMINAL.
Expand Down Expand Up @@ -100,7 +101,49 @@ data ktfmt_defaults: KtfmtConfig = KtfmtConfig {
}


// 🟡 gated — feature: formatter-config-patch — bind T-4.16 follow-on — dissolve-on-arrival: KtfmtConfigPatch type with per-field Override<T>/Inherit arms replaces full-config layering; forbidden: full-config replacement where partial field override is needed.
fn ktfmt_layer(base: KtfmtConfig, outer: KtfmtConfig) -> KtfmtConfig {
outer
type KtfmtConfigPatch {
style: FieldPatch<KtfmtStyle>
max_width: FieldPatch<KtfmtPositiveInt>
block_indent: FieldPatch<KtfmtPositiveInt>
continuation_indent: FieldPatch<KtfmtPositiveInt>
trailing_comma_management_strategy: FieldPatch<KtfmtTrailingCommaManagementStrategy>
remove_unused_imports: FieldPatch<Bool>
debugging_print_ops_after_formatting: FieldPatch<Bool>
dry_run: FieldPatch<Bool>
set_exit_if_changed: FieldPatch<Bool>
stdin_name: FieldPatch<String>
enable_editorconfig: FieldPatch<Bool>
quiet: FieldPatch<Bool>
editorconfig_max_line_length: FieldPatch<KtfmtPositiveInt>
editorconfig_indent_size: FieldPatch<KtfmtPositiveInt>
editorconfig_tab_width: FieldPatch<KtfmtPositiveInt>
editorconfig_ij_kotlin_indent_size: FieldPatch<KtfmtPositiveInt>
editorconfig_ij_continuation_indent_size: FieldPatch<KtfmtPositiveInt>
editorconfig_ij_kotlin_continuation_indent_size: FieldPatch<KtfmtPositiveInt>
editorconfig_ktfmt_trailing_comma_management_strategy: FieldPatch<KtfmtTrailingCommaManagementStrategy>
}


fn ktfmt_layer(base: KtfmtConfig, patch: KtfmtConfigPatch) -> KtfmtConfig {
KtfmtConfig {
style: apply_field_patch(base: base.style, patch: patch.style),
max_width: apply_field_patch(base: base.max_width, patch: patch.max_width),
block_indent: apply_field_patch(base: base.block_indent, patch: patch.block_indent),
continuation_indent: apply_field_patch(base: base.continuation_indent, patch: patch.continuation_indent),
trailing_comma_management_strategy: apply_field_patch(base: base.trailing_comma_management_strategy, patch: patch.trailing_comma_management_strategy),
remove_unused_imports: apply_field_patch(base: base.remove_unused_imports, patch: patch.remove_unused_imports),
debugging_print_ops_after_formatting: apply_field_patch(base: base.debugging_print_ops_after_formatting, patch: patch.debugging_print_ops_after_formatting),
dry_run: apply_field_patch(base: base.dry_run, patch: patch.dry_run),
set_exit_if_changed: apply_field_patch(base: base.set_exit_if_changed, patch: patch.set_exit_if_changed),
stdin_name: apply_field_patch(base: base.stdin_name, patch: patch.stdin_name),
enable_editorconfig: apply_field_patch(base: base.enable_editorconfig, patch: patch.enable_editorconfig),
quiet: apply_field_patch(base: base.quiet, patch: patch.quiet),
editorconfig_max_line_length: apply_field_patch(base: base.editorconfig_max_line_length, patch: patch.editorconfig_max_line_length),
editorconfig_indent_size: apply_field_patch(base: base.editorconfig_indent_size, patch: patch.editorconfig_indent_size),
editorconfig_tab_width: apply_field_patch(base: base.editorconfig_tab_width, patch: patch.editorconfig_tab_width),
editorconfig_ij_kotlin_indent_size: apply_field_patch(base: base.editorconfig_ij_kotlin_indent_size, patch: patch.editorconfig_ij_kotlin_indent_size),
editorconfig_ij_continuation_indent_size: apply_field_patch(base: base.editorconfig_ij_continuation_indent_size, patch: patch.editorconfig_ij_continuation_indent_size),
editorconfig_ij_kotlin_continuation_indent_size: apply_field_patch(base: base.editorconfig_ij_kotlin_continuation_indent_size, patch: patch.editorconfig_ij_kotlin_continuation_indent_size),
editorconfig_ktfmt_trailing_comma_management_strategy: apply_field_patch(base: base.editorconfig_ktfmt_trailing_comma_management_strategy, patch: patch.editorconfig_ktfmt_trailing_comma_management_strategy),
}
}
25 changes: 20 additions & 5 deletions src/v4/extdeps/formatters/lean4_format.dag
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// src/v4/extdeps/formatters/lean4_format.dag
// Scope: Lean 4 formatter configuration model — option space grounded in Lean 4 formatter/Lake option surfaces.
// Owns: Lean4NameValue, Lean4SyntaxValue, Lean4NatValue, lean4_nat_value_validation, make_lean4_nat_value, Lean4OptionValue, Lean4OptionAssignment,
// Lean4FormatConfig, lean4_format_defaults, lean4_format_layer.
// Consumes: Locus, Outcome, Symbol, Refined, Validation.
// Lean4FormatConfig, lean4_format_defaults, Lean4FormatConfigPatch, lean4_format_layer.
// Consumes: Locus, Outcome, Symbol, Refined, Validation, FieldPatch, apply_field_patch.
// Status: T-4.16 scaffold — full documented Lean formatter-facing option surface.
// Anchor: https://github.com/leanprover/lean4/blob/master/src/Lean/Data/Format.lean
// https://github.com/leanprover/lean4/blob/master/src/Lean/Data/Options.lean
Expand All @@ -13,6 +13,7 @@ module v4.extdeps.formatters.lean4_format
import v4.std.diagnostic { Locus, Outcome }
import v4.std.node { Symbol }
import v4.std.refinement { Refined, Validation, refine }
import v4.std.patch { FieldPatch, apply_field_patch }


type Lean4NameValue
Expand Down Expand Up @@ -75,7 +76,21 @@ data lean4_format_defaults: Lean4FormatConfig = Lean4FormatConfig {
}


// 🟡 gated — feature: formatter-config-patch — bind T-4.16 follow-on — dissolve-on-arrival: Lean4FormatConfigPatch type with per-field Override<T>/Inherit arms replaces full-config layering; forbidden: full-config replacement where partial field override is needed.
fn lean4_format_layer(base: Lean4FormatConfig, outer: Lean4FormatConfig) -> Lean4FormatConfig {
outer
type Lean4FormatConfigPatch {
format_width: FieldPatch<Lean4NatValue>
format_indent: FieldPatch<Lean4NatValue>
format_unicode: FieldPatch<Bool>
pp_oneline: FieldPatch<Bool>
lake_lean_options: FieldPatch<List<Lean4OptionAssignment>>
}


fn lean4_format_layer(base: Lean4FormatConfig, patch: Lean4FormatConfigPatch) -> Lean4FormatConfig {
Lean4FormatConfig {
format_width: apply_field_patch(base: base.format_width, patch: patch.format_width),
format_indent: apply_field_patch(base: base.format_indent, patch: patch.format_indent),
format_unicode: apply_field_patch(base: base.format_unicode, patch: patch.format_unicode),
pp_oneline: apply_field_patch(base: base.pp_oneline, patch: patch.pp_oneline),
lake_lean_options: apply_field_patch(base: base.lake_lean_options, patch: patch.lake_lean_options),
}
}
Loading
Loading