chore: merge main into feat/native-call-observation

Resolve conflicts against main:
- package.json: ship both the LLDB tracer bridge and main's process run
  token reader sources.
- README.md: take main's simplified English README, which no longer has
  the tool-family table.
- README_ja.md: take main's reworded table and count
  observe_native_calls in the macOS native row (7 -> 8).
- Skill: the references gain the observe_native_calls paragraph, so the
  version moves to 29 (main already uses 28).
- Regenerate the product catalog, conformance manifest, skill digest and
  package metadata (135 tools). The MCP tool catalog is now built rather
  than committed (#997), so it is removed here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-08 04:58:36 +00:00
co-authored by Claude Opus 5.5
581 changed files with 29516 additions and 12107 deletions
+21 -5
View File
@@ -60,10 +60,26 @@ export const nativeUiScenarioInputSchema = z.strictObject({
const nativeUiScreenshotSchema = z
.strictObject({
mime_type: z.literal("image/png"),
base64: z.string().min(4),
sha256: z.string().regex(/^[a-f0-9]{64}$/u),
width: z.number().int().positive(),
height: z.number().int().positive(),
base64: z
.string()
.min(4)
.describe(
"Canonical base64 encoding of PNG bytes; the decoded bytes must have a PNG signature and IHDR chunk.",
),
sha256: z
.string()
.regex(/^[a-f0-9]{64}$/u)
.describe("SHA-256 digest of the decoded PNG bytes."),
width: z
.number()
.int()
.positive()
.describe("Must equal the width encoded in the PNG IHDR chunk."),
height: z
.number()
.int()
.positive()
.describe("Must equal the height encoded in the PNG IHDR chunk."),
})
.superRefine((screenshot, context) => {
const bytes = decodeCanonicalBase64(screenshot.base64);
@@ -117,7 +133,7 @@ export const nativeUiSnapshotSchema = z.strictObject({
title: z.string().nullable(),
value: z.string().nullable(),
actions: z.array(z.string()),
children_count: z.number().int().nonnegative(),
children_count: z.number().int().nonnegative().nullable(),
}),
),
truncated: z.boolean(),
+1 -143
View File
@@ -1,150 +1,8 @@
import { fc } from "@fast-check/vitest";
import { describe, expect, it } from "vitest";
import {
countMethodsByType,
isDbSaveComplete,
isGetterSelector,
isSetterSelector,
inspectNativeDispatchMetadata,
propertyNameFromSelector,
swiftDeclsByKind,
type ObjcMethod,
type SwiftDecl,
type DbSaveResult,
} from "./objcSwiftMetadata.js";
import { inspectNativeDispatchMetadata } from "./objcSwiftMetadata.js";
describe("ObjC/Swift metadata", () => {
it("identifies getter selectors", () => {
expect(isGetterSelector("name")).toBe(true);
expect(isGetterSelector("setName:")).toBe(false);
expect(isGetterSelector("set")).toBe(true);
});
it("identifies setter selectors", () => {
expect(isSetterSelector("setName:")).toBe(true);
expect(isSetterSelector("name")).toBe(false);
});
it("extracts property name from selector", () => {
expect(propertyNameFromSelector("name")).toBe("name");
expect(propertyNameFromSelector("setName:")).toBe("name");
expect(propertyNameFromSelector("set")).toBe("set");
});
it("counts methods by type", () => {
const methods: ObjcMethod[] = [
{
selector: "init",
method_type: "instance",
address: 0x1000,
is_required: false,
is_optional: false,
},
{
selector: "alloc",
method_type: "class",
address: 0x2000,
is_required: false,
is_optional: false,
},
];
const counts = countMethodsByType(methods);
expect(counts.instance).toBe(1);
expect(counts.class).toBe(1);
expect(counts.ivar_getter).toBe(0);
expect(counts.ivar_setter).toBe(0);
});
it("filters Swift declarations by kind", () => {
const decls: SwiftDecl[] = [
{
kind: "class",
name: "Foo",
module: null,
access_level: "public",
super_class: null,
protocols: [],
is_final: false,
is_required: false,
is_convenience_init: false,
is_override: false,
},
];
const classes = swiftDeclsByKind(decls, "class");
expect(classes).toHaveLength(1);
expect(classes[0]!.name).toBe("Foo");
});
it("checks database save completeness", () => {
const result: DbSaveResult = {
operation: "save",
succeeded: true,
preserved_names: 10,
preserved_comments: 5,
preserved_bookmarks: 3,
database_path: "/tmp/db.hop",
error: null,
};
expect(isDbSaveComplete(result, 10, 5, 3)).toBe(true);
expect(isDbSaveComplete(result, 11, 5, 3)).toBe(false);
});
it("is monotone in every expected count and total at the observed count", () => {
fc.assert(
fc.property(
fc.record({
operation: fc.constantFrom(
"save",
"readback",
"open_database",
"close_database",
"export",
"import",
),
succeeded: fc.boolean(),
preserved_names: fc.nat({ max: 50 }),
preserved_comments: fc.nat({ max: 50 }),
preserved_bookmarks: fc.nat({ max: 50 }),
database_path: fc.option(fc.string(), { nil: null }),
error: fc.option(fc.string(), { nil: null }),
}),
fc.nat({ max: 50 }),
fc.nat({ max: 50 }),
fc.nat({ max: 50 }),
(result, names, comments, bookmarks) => {
// Completeness is downward closed: if demanding more was met,
// demanding less must also be met.
if (isDbSaveComplete(result, names + 1, comments, bookmarks)) {
expect(isDbSaveComplete(result, names, comments, bookmarks)).toBe(
true,
);
}
if (isDbSaveComplete(result, names, comments + 1, bookmarks)) {
expect(isDbSaveComplete(result, names, comments, bookmarks)).toBe(
true,
);
}
if (isDbSaveComplete(result, names, comments, bookmarks + 1)) {
expect(isDbSaveComplete(result, names, comments, bookmarks)).toBe(
true,
);
}
// Expecting exactly what was preserved is complete iff the save worked.
expect(
isDbSaveComplete(
result,
result.preserved_names,
result.preserved_comments,
result.preserved_bookmarks,
),
).toBe(result.succeeded);
},
),
{ numRuns: 200 },
);
});
it("bounds symbol projections and labels symbol-only metadata as partial", () => {
const result = inspectNativeDispatchMetadata(
[
+4 -65
View File
@@ -7,7 +7,6 @@ export const objcMethodTypeSchema = z.enum([
"ivar_getter",
"ivar_setter",
]);
export type ObjcMethodType = z.infer<typeof objcMethodTypeSchema>;
/** Objective-C property attribute. */
export const objcPropertyAttributeSchema = z.strictObject({
@@ -27,7 +26,7 @@ export const objcMethodSchema = z.strictObject({
is_required: z.boolean().default(false),
is_optional: z.boolean().default(false),
});
export type ObjcMethod = z.infer<typeof objcMethodSchema>;
type ObjcMethod = z.infer<typeof objcMethodSchema>;
/** Objective-C property metadata. */
export const objcPropertySchema = z.strictObject({
@@ -87,7 +86,7 @@ export const objcClassSchema = z.strictObject({
)
.optional(),
});
export type ObjcClass = z.infer<typeof objcClassSchema>;
type ObjcClass = z.infer<typeof objcClassSchema>;
/** Exact location of a decoded native metadata value when the provider knows it. */
export const nativeMetadataLocationSchema = z.strictObject({
@@ -162,7 +161,7 @@ export const objcDispatchImplementationSchema = z.strictObject({
decode: nativeMetadataDecodeSchema,
evidence: z.array(nativeMetadataEvidenceSchema).min(1),
});
export type ObjcDispatchImplementation = z.infer<
type ObjcDispatchImplementation = z.infer<
typeof objcDispatchImplementationSchema
>;
@@ -224,7 +223,7 @@ export const swiftSymbolSchema = z.strictObject({
decode: nativeMetadataDecodeSchema,
evidence: z.array(nativeMetadataEvidenceSchema).min(1),
});
export type SwiftSymbol = z.infer<typeof swiftSymbolSchema>;
type SwiftSymbol = z.infer<typeof swiftSymbolSchema>;
/** Per-facet coverage; empty arrays are meaningful only with this record. */
export const nativeMetadataCoverageSchema = z.strictObject({
@@ -246,7 +245,6 @@ export const swiftDeclKindSchema = z.enum([
"global_var",
"global_func",
]);
export type SwiftDeclKind = z.infer<typeof swiftDeclKindSchema>;
/** Swift access level. */
export const swiftAccessLevelSchema = z.enum([
@@ -269,7 +267,6 @@ export const swiftDeclSchema = z.strictObject({
is_convenience_init: z.boolean().default(false),
is_override: z.boolean().default(false),
});
export type SwiftDecl = z.infer<typeof swiftDeclSchema>;
/** Database save/read operation type. */
export const dbOperationSchema = z.enum([
@@ -290,7 +287,6 @@ export const dbSaveResultSchema = z.strictObject({
database_path: z.string().nullable(),
error: z.string().nullable(),
});
export type DbSaveResult = z.infer<typeof dbSaveResultSchema>;
/** Result of deeper ObjC/Swift metadata extraction. */
export const objcSwiftMetadataSchema = z.strictObject({
@@ -479,60 +475,3 @@ const parseMetadataAddress = (address: string | null): number | null => {
const value = Number.parseInt(match[1], 16);
return Number.isSafeInteger(value) ? value : null;
};
/** Check if a selector name looks like a getter. */
export function isGetterSelector(selector: string): boolean {
return /^[a-z][a-zA-Z0-9_]*$/u.test(selector) && !selector.includes(":");
}
/** Check if a selector name looks like a setter. */
export function isSetterSelector(selector: string): boolean {
return selector.startsWith("set") && selector.endsWith(":");
}
/** Extract property name from a getter/setter selector. */
export function propertyNameFromSelector(selector: string): string | null {
if (isSetterSelector(selector)) {
const inner = selector.slice(3, -1);
return inner.charAt(0).toLowerCase() + inner.slice(1);
}
if (isGetterSelector(selector)) {
return selector;
}
return null;
}
/** Count ObjC methods by type. */
export function countMethodsByType(
methods: readonly ObjcMethod[],
): Record<ObjcMethodType, number> {
return {
instance: methods.filter((m) => m.method_type === "instance").length,
class: methods.filter((m) => m.method_type === "class").length,
ivar_getter: methods.filter((m) => m.method_type === "ivar_getter").length,
ivar_setter: methods.filter((m) => m.method_type === "ivar_setter").length,
};
}
/** Get all Swift declarations of a specific kind. */
export function swiftDeclsByKind(
decls: readonly SwiftDecl[],
kind: SwiftDeclKind,
): SwiftDecl[] {
return decls.filter((d) => d.kind === kind);
}
/** Check if a database save preserved all expected items. */
export function isDbSaveComplete(
result: DbSaveResult,
expectedNames: number,
expectedComments: number,
expectedBookmarks: number,
): boolean {
return (
result.succeeded &&
result.preserved_names >= expectedNames &&
result.preserved_comments >= expectedComments &&
result.preserved_bookmarks >= expectedBookmarks
);
}