Skip to content

docs: focus AGENTS.md on myschema, drop pistachio / pingcap context#38

Merged
winebarrel merged 6 commits into
mainfrom
docs-focus-on-myschema
May 3, 2026
Merged

docs: focus AGENTS.md on myschema, drop pistachio / pingcap context#38
winebarrel merged 6 commits into
mainfrom
docs-focus-on-myschema

Conversation

@winebarrel

Copy link
Copy Markdown
Owner

Summary

Rewrites the affected sections of AGENTS.md (= CLAUDE.md, symlinked) so the guide describes myschema on its own terms instead of as "the MySQL counterpart to pistachio". Drops the comparison preamble, the migration-from-pingcap history, and a couple of stale implementation notes that pointed at code paths the project no longer takes.

Why

The pistachio framing was useful at bootstrap, but the project has its own identity now and the historical references made the guide harder to read for someone landing on the repo cold. A few of the inherited paragraphs also referenced things that aren't true any more (TiDBStrictIntegerDisplayWidth, Length = -1).

Sections changed

  • What this is — describes myschema and its three subcommands directly; vitess named without the "we migrated from pingcap" history.
  • Why vitess (and not pingcap/tidb/pkg/parser)Parser quirks worth knowing — same actionable bullets (vitess select-list shape, CREATE INDEXAlterTable, CURRENT_TIMESTAMP paren handling, bareword default wrapping) without the comparison preamble or binary-size before/after.
  • Coverage vs. pistachioCoverage. "Not yet implemented (intentional v1 cuts; would mirror pistachio)" → "Not yet implemented (intentional v1 cuts)".
  • WITH CHECK OPTION bullet now attributes the limitation to vitess's AST (matches the actual code).
  • Database-name remap entry describes the proposed -m old=new flag on its own terms (no --schema-map cross-reference).
  • "Inherited from pistachio. …" preambles in Development workflow and Code conventions are removed.
  • Code conventions: TiDBStrictIntegerDisplayWidth line removed (no longer used; MySQL 8.0+ + vitess naturally agree on integer type names). Index Length note now describes vitess's *int shape, not pingcap's sentinel.

No code changes.

Test plan

  • grep -i 'pistachio\|pingcap\|tidb' AGENTS.md returns nothing
  • make lint
  • make test-unit

🤖 Generated with Claude Code

The original guide read as "myschema is the MySQL counterpart to
pistachio" and carried a lot of historical baggage from that
framing — explicit pistachio / pingcap-vs-vitess comparisons,
"inherited from pistachio" pointers in workflow / conventions, and
implementation notes that referenced the long-gone pingcap parser
(`TiDBStrictIntegerDisplayWidth`, `Length = -1`).

Rewrite the affected sections so the guide stands on its own:

- "What this is" describes the tool and its three subcommands
  directly; vitess is mentioned as the parser of record without the
  "we migrated from pingcap" history.
- The old "Why vitess (and not pingcap/tidb/pkg/parser)" section
  becomes "Parser quirks worth knowing" — same actionable bullets
  (vitess select-list shape, CREATE INDEX → AlterTable, CURRENT_TIMESTAMP
  paren handling, bareword default wrapping) without the comparison
  preamble or binary-size before/after.
- "Coverage vs. pistachio" → "Coverage". "Not yet implemented
  (intentional v1 cuts; would mirror pistachio)" → "Not yet
  implemented (intentional v1 cuts)".
- WITH CHECK OPTION bullet now attributes the limitation to vitess's
  AST (matches the actual code), not pingcap's.
- Database-name remap entry describes the proposed `-m old=new` flag
  on its own terms.
- "Inherited from pistachio. Apply the same discipline here:" /
  "Inherited from pistachio. The MySQL-specific bits sit at the
  bottom." preambles are removed; the workflow / conventions stand
  as myschema's own.
- Code conventions: `TiDBStrictIntegerDisplayWidth` reference removed
  (no longer used; MySQL 8.0+ + vitess naturally agree on integer
  type names). Index Length note now describes vitess's `*int`
  shape, not pingcap's `Length = -1` sentinel.

CLAUDE.md is a symlink to AGENTS.md so both files reflect the
change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 3, 2026 02:57
@codecov

codecov Bot commented May 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.67%. Comparing base (ce044af) to head (89e0e5b).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
+ Coverage   73.40%   73.67%   +0.27%     
==========================================
  Files          27       27              
  Lines        2151     2234      +83     
==========================================
+ Hits         1579     1646      +67     
- Misses        412      425      +13     
- Partials      160      163       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates AGENTS.md to describe myschema independently (without pistachio/pingcap/TiDB historical framing) and refreshes a few implementation notes to match current behavior.

Changes:

  • Rewrites the “What this is” section to describe myschema’s workflow and subcommands directly.
  • Renames/reframes parser rationale into “Parser quirks worth knowing” and updates several bullets.
  • Cleans up “Coverage”, “Development workflow”, and “Code conventions” to remove legacy comparison context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Two valid nits:

- Spell out the full module path for the MySQL driver
  (`github.com/go-sql-driver/mysql`) instead of the short
  `go-sql-driver/mysql` so a reader landing on the guide can
  match it against `go.mod` directly.
- The "bareword default wrapping" bullet listed ENUM / SET / CHAR /
  temporal as if normalizeColumnDefault were type-aware for the
  non-empty case. It isn't — for non-empty defaults it parses
  `SELECT <def>` and wraps anything vitess sees as a `*ColName`,
  regardless of the column's declared type. Rewrite the bullet to
  describe the actual code path (type-agnostic for non-empty,
  type-aware only for the empty-string special case via
  columnTypeAllowsEmptyStringDefault).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md Outdated
Switch "serialise" → "serialize" in the "What this is" intro to
match the existing "the serialized output is deterministic" comment
in model/table.go. AGENTS.md still has UK-spelled "normalise" in a
few places, but normalising every spelling difference is out of
scope for this docs PR — keep the change narrow to the one Copilot
flagged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md Outdated
do drift

Previous wording claimed "Integer display widths don't surface from
either side on MySQL 8.0+, so no explicit stripping is needed."
That's wrong, and Copilot caught it. Verified against the live
docker-compose MySQL 8.0:

- catalog (`information_schema.COLUMNS.COLUMN_TYPE`) strips the
  display width — `INT(11)` stored in DDL surfaces as `int`.
- vitess preserves whatever the user wrote in desired SQL —
  `INT(11)` round-trips through `sqlparser.String` as `int(11)`.

myschema doesn't normalise either side, so `INT(11)` in desired SQL
shows up as a `MODIFY COLUMN` drift on every plan. The right
mitigation is on the user side: write the bare type name (`INT`,
`BIGINT`, …) in desired SQL.

Rewrite the bullet to call out the asymmetry directly and mention
the `ZEROFILL` exception (MySQL preserves it in `COLUMN_TYPE` —
verified to come back as `int(5) unsigned zerofill` — so it is
round-trip-safe as long as the implicit `UNSIGNED` is also written).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md Outdated
case

Previous wording said the empty-string default was the *only*
type-aware path in `normalizeColumnDefault`. That was true at one
point but PR #34 added a second type-aware branch: a fixed-width
`BINARY(N)` column with `DEFAULT ''` surfaces from MySQL as the
literal two-character string `"0x"` (independent of N), and the
catalog rewrites that sentinel back to `''` when the type-name
starts with `binary`.

Restructure the bullet into a short three-case list (non-empty
type-agnostic / empty-string type-aware / BINARY(N) "0x" type-aware)
so the docs match the code.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md Outdated
arises

Previous wording said "the catalog returns 0", which implied MySQL
itself reports a literal 0 for indexes without a prefix length. It
doesn't — `information_schema.STATISTICS.SUB_PART` is NULL in that
case. The catalog loader scans it into a `*int`; when nil it leaves
`model.IndexPart.Length` at the struct zero-value (0). vitess's
`IndexColumn.Length` is the symmetric `*int` on the parser side.

Reword the bullet so it describes both sides as `*int` carrying nil
for "no prefix", and call out that the equal-at-0 comparison is the
result of the struct default — not a quirk of MySQL's response.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@winebarrel winebarrel merged commit 8fb5d92 into main May 3, 2026
9 checks passed
@winebarrel winebarrel deleted the docs-focus-on-myschema branch May 3, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants