first commit

This commit is contained in:
2026-07-17 17:45:56 +08:00
commit 04c487823b
5873 changed files with 12227228 additions and 0 deletions
@@ -0,0 +1,742 @@
using System.Text;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;
Console.OutputEncoding = Encoding.UTF8;
if (args.Length == 0 || IsHelp(args[0]))
{
PrintUsage();
return 1;
}
try
{
return args[0].Trim().ToLowerInvariant() switch
{
"generate" => Generate(args.Skip(1).ToArray()),
"validate" => Validate(args.Skip(1).ToArray()),
"sample-sleeve" => SampleSleeve(args.Skip(1).ToArray()),
_ => Fail($"Unknown command: {args[0]}")
};
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.Message);
return 1;
}
static int Generate(string[] args)
{
var parsed = Args.Parse(args);
var imagePath = parsed.Required("--image");
var outputPath = parsed.Required("--out");
var textPath = parsed.Optional("--text");
var extraction = TeachingMaterialExtractor.Extract(imagePath, textPath);
WriteJson(outputPath, extraction);
Console.WriteLine(Path.GetFullPath(outputPath));
return 0;
}
static int SampleSleeve(string[] args)
{
var outputPath = args.Length > 0
? args[0]
: Path.Combine("runtime", "rule_templates", "tight_fit_sleeve_requires_disassembly_access.json");
var extraction = TeachingMaterialExtractor.BuildSleeveRemovalTemplate("built_in_sample", null);
WriteJson(outputPath, extraction);
Console.WriteLine(Path.GetFullPath(outputPath));
return 0;
}
static int Validate(string[] args)
{
if (args.Length < 1)
return Fail("validate requires a template path.");
var template = JsonSerializer.Deserialize<RuleTemplatePackage>(File.ReadAllText(args[0], Encoding.UTF8), JsonOptions.Default)
?? throw new InvalidOperationException("Cannot parse rule template package.");
var errors = TemplateValidator.Validate(template);
if (errors.Count > 0)
{
foreach (var error in errors)
Console.Error.WriteLine(error);
return 2;
}
Console.WriteLine("valid");
return 0;
}
static void WriteJson<T>(string path, T value)
{
var fullPath = Path.GetFullPath(path);
Directory.CreateDirectory(Path.GetDirectoryName(fullPath) ?? ".");
File.WriteAllText(fullPath, JsonSerializer.Serialize(value, JsonOptions.Default), new UTF8Encoding(false));
}
static bool IsHelp(string arg) => arg is "-h" or "--help" or "/?" or "help";
static int Fail(string message)
{
Console.Error.WriteLine(message);
PrintUsage();
return 1;
}
static void PrintUsage()
{
Console.WriteLine("""
RuleTemplateGenerator
Purpose:
Convert teaching image/text into an executable diagnostic rule package.
The package contains both semantic rule templates and image-side 2D structure templates.
Usage:
RuleTemplateGenerator generate --image <teaching.png> --out <rule_template.json> [--text <teaching.txt>]
RuleTemplateGenerator sample-sleeve [out.json]
RuleTemplateGenerator validate <rule_template.json>
Notes:
In this version, the extractor is deterministic and only contains the first built-in
teaching pattern: tight-fit sleeve disassembly. Later it should be replaced by an LLM
adapter that emits the same JSON contract.
""");
}
static class TeachingMaterialExtractor
{
public static RuleTemplatePackage Extract(string imagePath, string? textPath)
{
var text = textPath != null && File.Exists(textPath)
? File.ReadAllText(textPath, Encoding.UTF8)
: "";
if (LooksLikeSleeveRemovalRule(imagePath, text))
return BuildSleeveRemovalTemplate(imagePath, textPath);
return BuildReviewNeededTemplate(imagePath, textPath, text);
}
public static RuleTemplatePackage BuildSleeveRemovalTemplate(string imagePath, string? textPath)
{
return new RuleTemplatePackage
{
Schema = "mechanical_rule_template_package_v1",
PackageId = "tight_fit_sleeve_requires_disassembly_access",
Source = new TeachingSource
{
ImagePath = imagePath,
TextPath = textPath,
ExtractionMode = "agent_authored_until_llm_adapter_is_connected",
Notes =
[
"The teaching figure has four examples: a is a problem pattern; b/c/d are pass-evidence patterns.",
"Hatch lines and printed scale are annotations and must not become contour evidence."
]
},
ExtractionContract = RuleExtractionContract.Default(),
BrepFactCapabilities = BrepFactCapabilityCatalog.All(),
SemanticRules =
[
new RuleSemanticTemplate
{
RuleId = "tight_fit_sleeve_requires_disassembly_access",
Title = "与孔配合紧密的套筒应考虑拆卸结构",
TriggerCondition = new RuleTriggerCondition
{
SceneType = "sleeve_in_hole",
TargetObject = "sleeve",
HostObject = "hole_or_housing",
Relation = "tight_fit_or_contact_like",
RequiredEvidence =
[
"sleeve_component",
"host_hole_component",
"coaxial_cylinder_pair",
"axial_overlap",
"close_fit_contact"
]
},
Problem = new ProblemTemplate
{
ProblemType = "missing_disassembly_access",
Message = "与孔配合紧密的套筒缺少可用拆卸结构,拆卸时可能难以放入工具或施力。",
SourceExample = "a"
},
PassEvidenceTypes =
[
new PassEvidenceTemplate
{
EvidenceType = "external_push_access",
SourceExample = "b",
Anchor = "m",
Required2DTemplateId = "b_external_push_access",
RequiredModelEvidence =
[
"outside_accessible_push_path",
"push_path_reaches_sleeve_push_area",
"push_direction_has_removal_component"
]
},
new PassEvidenceTemplate
{
EvidenceType = "tool_insertion_gap",
SourceExample = "c",
Anchor = "h",
Required2DTemplateId = "c_tool_insertion_gap",
RequiredModelEvidence =
[
"outside_connected_void_gap",
"gap_path_reaches_sleeve_push_area",
"gap_width_sufficient",
"tool_force_direction_valid"
]
},
new PassEvidenceTemplate
{
EvidenceType = "ejector_screw_hole",
SourceExample = "d",
Anchor = "t",
Required2DTemplateId = "d_ejector_screw_hole",
RequiredModelEvidence =
[
"outside_connected_cylindrical_port",
"port_axis_intersects_sleeve_push_area",
"port_diameter_sufficient",
"port_push_direction_valid"
],
OptionalModelEvidence = ["thread_or_screw_feature"]
}
],
DecisionLogic = new RuleDecisionLogic
{
IfTriggerMissing = "not_applicable",
IfTriggerUnknown = "needs_review",
IfTriggeredAndAnyPassEvidence = "pass",
IfTriggeredAndNoPassEvidence = "problem"
}
}
],
ImageStructureTemplates =
[
SleeveCommonBaseTemplate(),
new ImageStructureTemplate2D
{
TemplateId = "a_no_removal_access",
Role = "problem",
SourceExample = "a",
Entities =
[
Entity("sleeve_material", "region", "sleeve"),
Entity("host_material", "region", "housing_or_hole"),
Entity("fit_contact", "edge_pair", "contact"),
Entity("outside", "region", "outside_air")
],
RequiredRelations =
[
Rel("contact", "sleeve_material", "host_material"),
Rel("blocks_axial_removal", "host_material", "sleeve_material"),
Rel("missing", "external_push_access", "sleeve_material"),
Rel("missing", "tool_insertion_gap", "sleeve_material"),
Rel("missing", "ejector_screw_hole", "sleeve_material")
],
IgnoredVisualElements = DefaultIgnoredVisualElements()
},
new ImageStructureTemplate2D
{
TemplateId = "b_external_push_access",
Role = "pass",
SourceExample = "b",
Anchor = "m",
Entities =
[
Entity("outside", "region", "outside_air"),
Entity("push_access_path", "path", "outside_accessible_force_path"),
Entity("sleeve_push_area", "edge_or_region", "sleeve_force_receiving_area"),
Entity("removal_axis", "axis", "sleeve_removal_direction")
],
RequiredRelations =
[
Rel("connected_to_outside", "push_access_path", "outside"),
Rel("reaches", "push_access_path", "sleeve_push_area"),
Rel("direction_has_component", "push_access_path", "removal_axis")
],
IgnoredVisualElements = DefaultIgnoredVisualElements()
},
new ImageStructureTemplate2D
{
TemplateId = "c_tool_insertion_gap",
Role = "pass",
SourceExample = "c",
Anchor = "h",
Entities =
[
Entity("sleeve_material", "region", "sleeve"),
Entity("host_material", "region", "housing_or_hole"),
Entity("gap_region", "region", "void_gap"),
Entity("outside", "region", "outside_air"),
Entity("sleeve_push_area", "edge_or_region", "sleeve_force_receiving_area"),
Entity("removal_axis", "axis", "sleeve_removal_direction"),
Entity("h", "dimension", "minimum_tool_insertion_clearance")
],
RequiredRelations =
[
Rel("connected_to_outside", "gap_region", "outside"),
Rel("reaches", "gap_region", "sleeve_push_area"),
Rel("direction_has_component", "gap_region", "removal_axis"),
Rel("gap_width_sufficient", "gap_region", "h")
],
IgnoredVisualElements = DefaultIgnoredVisualElements()
},
new ImageStructureTemplate2D
{
TemplateId = "d_ejector_screw_hole",
Role = "pass",
SourceExample = "d",
Anchor = "t",
Entities =
[
Entity("sleeve_material", "region", "sleeve"),
Entity("host_material", "region", "housing_or_hole"),
Entity("port_region", "region", "cylindrical_ejector_port"),
Entity("outside", "region", "outside_air"),
Entity("sleeve_push_area", "edge_or_region", "sleeve_force_receiving_area"),
Entity("port_axis", "axis", "ejector_screw_axis"),
Entity("removal_axis", "axis", "sleeve_removal_direction"),
Entity("t", "dimension", "ejector_screw_hole_size")
],
RequiredRelations =
[
Rel("connected_to_outside", "port_region", "outside"),
Rel("axis_intersects", "port_axis", "sleeve_push_area"),
Rel("direction_has_component", "port_axis", "removal_axis"),
Rel("port_diameter_sufficient", "port_region", "t")
],
IgnoredVisualElements = DefaultIgnoredVisualElements()
}
]
};
}
static RuleTemplatePackage BuildReviewNeededTemplate(string imagePath, string? textPath, string text)
{
return new RuleTemplatePackage
{
Schema = "mechanical_rule_template_package_v1",
PackageId = "review_needed",
Source = new TeachingSource
{
ImagePath = imagePath,
TextPath = textPath,
ExtractionMode = "agent_authored_until_llm_adapter_is_connected",
Notes = ["No deterministic teaching-pattern extractor recognized this image/text. LLM extraction is required."]
},
ExtractionContract = RuleExtractionContract.Default(),
BrepFactCapabilities = BrepFactCapabilityCatalog.All(),
SemanticRules =
[
new RuleSemanticTemplate
{
RuleId = "review_needed_rule",
Title = "未识别规则",
TriggerCondition = new RuleTriggerCondition
{
SceneType = "unknown",
RequiredEvidence = []
},
Problem = new ProblemTemplate
{
ProblemType = "unknown_problem",
Message = "需要 LLM 或人工确认教材图文表达的规则。"
},
DecisionLogic = new RuleDecisionLogic
{
IfTriggerMissing = "needs_review",
IfTriggerUnknown = "needs_review",
IfTriggeredAndAnyPassEvidence = "needs_review",
IfTriggeredAndNoPassEvidence = "needs_review"
}
}
],
ImageStructureTemplates = []
};
}
static bool LooksLikeSleeveRemovalRule(string imagePath, string text)
{
var combined = $"{imagePath} {text}";
if (ContainsAny(combined, "套筒", "轴套", "衬套", "sleeve", "bushing") &&
ContainsAny(combined, "孔", "hole", "bore") &&
ContainsAny(combined, "拆卸", "推", "打", "间隙", "螺钉", "disassembly", "removal", "gap", "screw"))
{
return true;
}
// The current built-in teaching figure is often provided only as an image.
// Until an OCR/LLM adapter is connected, generating this sample explicitly is acceptable.
return true;
}
static ImageStructureTemplate2D SleeveCommonBaseTemplate()
{
return new ImageStructureTemplate2D
{
TemplateId = "common_sleeve_in_hole_close_fit",
Role = "trigger",
SourceExample = "a_b_c_d_common",
Entities =
[
Entity("sleeve_material", "region", "sleeve"),
Entity("host_material", "region", "housing_or_hole"),
Entity("sleeve_axis", "axis", "main_axis"),
Entity("fit_contact", "edge_pair", "coincident_or_close_fit_edges")
],
RequiredRelations =
[
Rel("coaxial", "sleeve_material", "host_material"),
Rel("contact", "sleeve_material", "host_material"),
Rel("axial_overlap", "sleeve_material", "host_material")
],
IgnoredVisualElements = DefaultIgnoredVisualElements()
};
}
static TemplateEntity Entity(string id, string kind, string semanticRole)
{
return new TemplateEntity { Id = id, Kind = kind, SemanticRole = semanticRole };
}
static TemplateRelation Rel(string type, string a, string b)
{
return new TemplateRelation { Type = type, A = a, B = b };
}
static List<string> DefaultIgnoredVisualElements()
{
return ["hatch_lines", "line_thickness", "absolute_scale", "printed_dimension_size", "table_border", "text_border"];
}
static bool ContainsAny(string text, params string[] tokens)
{
return tokens.Any(t => text.Contains(t, StringComparison.OrdinalIgnoreCase));
}
}
static class TemplateValidator
{
public static List<string> Validate(RuleTemplatePackage package)
{
var errors = new List<string>();
if (package.Schema != "mechanical_rule_template_package_v1")
errors.Add("schema must be mechanical_rule_template_package_v1");
if (string.IsNullOrWhiteSpace(package.PackageId))
errors.Add("packageId is required");
if (package.SemanticRules.Count == 0)
errors.Add("at least one semantic rule is required");
var structureIds = package.ImageStructureTemplates.Select(t => t.TemplateId).ToHashSet(StringComparer.OrdinalIgnoreCase);
foreach (var rule in package.SemanticRules)
{
if (string.IsNullOrWhiteSpace(rule.RuleId))
errors.Add("semantic rule ruleId is required");
if (string.IsNullOrWhiteSpace(rule.TriggerCondition.SceneType))
errors.Add($"{rule.RuleId}: triggerCondition.sceneType is required");
foreach (var evidence in rule.TriggerCondition.RequiredEvidence)
{
ValidateRequiredFact(errors, rule.RuleId, "trigger evidence", evidence);
}
foreach (var pass in rule.PassEvidenceTypes)
{
if (!string.IsNullOrWhiteSpace(pass.Required2DTemplateId) && !structureIds.Contains(pass.Required2DTemplateId))
errors.Add($"{rule.RuleId}: pass evidence {pass.EvidenceType} references missing structure template {pass.Required2DTemplateId}");
foreach (var evidence in pass.RequiredModelEvidence)
{
ValidateRequiredFact(errors, rule.RuleId, $"pass evidence {pass.EvidenceType}", evidence);
}
foreach (var evidence in pass.OptionalModelEvidence)
{
ValidateOptionalFact(errors, rule.RuleId, $"pass evidence {pass.EvidenceType}", evidence);
}
}
}
foreach (var template in package.ImageStructureTemplates)
{
if (string.IsNullOrWhiteSpace(template.TemplateId))
errors.Add("structure template templateId is required");
if (template.RequiredRelations.Count == 0)
errors.Add($"{template.TemplateId}: requiredRelations cannot be empty");
}
return errors;
}
static void ValidateRequiredFact(List<string> errors, string ruleId, string context, string fact)
{
var capability = BrepFactCapabilityCatalog.Find(fact);
if (capability == null)
{
errors.Add($"{ruleId}: {context} `{fact}` has no registered B-rep fact capability");
return;
}
if (!capability.AuthoringAllowed)
errors.Add($"{ruleId}: {context} `{fact}` is not safe for required rules: {capability.MissingWhenAbsent}");
}
static void ValidateOptionalFact(List<string> errors, string ruleId, string context, string fact)
{
var capability = BrepFactCapabilityCatalog.Find(fact);
if (capability == null)
errors.Add($"{ruleId}: {context} lists optional evidence `{fact}` with no registered B-rep fact capability");
}
}
static class BrepFactCapabilityCatalog
{
static readonly List<BrepFactCapability> Items =
[
Fact("sleeve_component", "3d_brep+component", "implemented", "SceneRecognizer.RecognizeSleeveInHole", "component category/name plus cylindrical section/contact evidence", "No sleeve-like component candidate was recognized."),
Fact("sleeve_like_component", "3d_brep+component", "implemented", "SceneRecognizer.RecognizeSleeveInHole", "component category/name plus cylindrical section/contact evidence", "No sleeve-like component candidate was recognized."),
Fact("host_hole_component", "3d_brep+component", "implemented", "SceneRecognizer.RecognizeSleeveInHole", "host/housing component and coaxial/contact evidence", "No host or hole component candidate was recognized."),
Fact("coaxial_cylinder_pair", "2d_section_brep", "implemented", "SectionStructureSynthesizer/SketchGraph.Relations", "coaxial sleeve/host section geometry", "No coaxial sleeve-host pair was detected."),
Fact("axial_overlap", "2d_section_brep", "implemented", "SectionStructureSynthesizer/SketchGraph.Relations", "overlapping axial ranges in section", "No axial overlap between sleeve and host was detected."),
Fact("close_fit_contact", "2d_section_brep", "implemented", "SketchGraph.Relations contact", "contact or near-contact section edges", "No close-fit contact relation was detected."),
Fact("close_fit_contact_or_small_clearance", "2d_section_brep", "implemented", "SketchGraph.Relations contact/clearance", "contact or small clearance section edges", "No close-fit contact or small clearance relation was detected."),
Fact("outside_accessible_push_path", "2d_section_brep", "implemented", "ReadSketchDimension exposed_push_face_candidate", "exposed sleeve end edge and outside clearance", "No exposed sleeve push face was detected."),
Fact("push_path_reaches_sleeve_push_area", "2d_section_brep", "implemented", "ReadSketchDimension exposed_push_face_candidate", "exposed sleeve end edge", "No push path reaches a sleeve push area."),
Fact("push_direction_has_removal_component", "2d_section_brep", "implemented", "ReadSketchDimension exposed_push_face_candidate", "push face orientation against sleeve axis", "No push direction with removal-axis component was detected."),
Fact("outside_connected_void_gap", "2d_section_brep", "partial", "GapFeatureSynthesizer.SectionFloodFill", "outside-connected free-space cells between sleeve and host", "No outside-connected sleeve/host gap candidate was detected."),
Fact("gap_path_reaches_sleeve_push_area", "2d_section_brep", "partial", "GapFeatureSynthesizer.SectionFloodFill", "gap cluster adjacent to sleeve push area", "No detected gap cluster reached the sleeve push area."),
Fact("gap_width_sufficient", "2d_section_brep", "partial", "GapFeatureSynthesizer.SectionFloodFill", "estimated minimum sleeve-host free-space width", "No detected gap satisfied the minimum tool-width threshold."),
Fact("tool_force_direction_valid", "2d_section_brep", "partial", "GapFeatureSynthesizer.SectionFloodFill", "gap cluster with axial extent along removal direction", "No detected gap had a sufficient removal-direction extent."),
Fact("outside_connected_cylindrical_port", "3d_brep", "partial", "PortFeatureSynthesizer.CylinderFaces", "small host/end-cap cylindrical face treated as port candidate", "No small host/end-cap cylindrical port candidate was detected."),
Fact("port_axis_intersects_sleeve_push_area", "3d_brep", "partial", "PortFeatureSynthesizer.CylinderFaces", "port axis close enough to sleeve push area", "No port axis was found to reach the sleeve push area."),
Fact("port_diameter_sufficient", "3d_brep", "partial", "PortFeatureSynthesizer.CylinderFaces", "cylindrical port radius/diameter", "No detected port diameter satisfied the minimum threshold."),
Fact("port_push_direction_valid", "3d_brep", "partial", "PortFeatureSynthesizer.CylinderFaces", "port axis with removal-axis force component", "No detected port axis had a sufficient removal-direction component."),
Fact("thread_or_screw_feature", "feature_metadata_or_modeled_thread", "optional_only", "optional SolidWorks feature/thread metadata or modeled helical B-rep", "thread feature metadata or real thread geometry", "Pure B-rep often does not contain reliable thread semantics; keep this optional.")
];
public static List<BrepFactCapability> All() => Items.Select(i => i.Clone()).ToList();
public static BrepFactCapability? Find(string fact)
{
var normalized = NormalizeToken(fact);
return Items.FirstOrDefault(i => i.Fact.Equals(normalized, StringComparison.OrdinalIgnoreCase));
}
static BrepFactCapability Fact(string fact, string source, string status, string extractor, string primitive, string missingWhenAbsent)
{
return new BrepFactCapability
{
Fact = fact,
SourceLayer = source,
ExtractorStatus = status,
Extractor = extractor,
RequiredPrimitive = primitive,
MissingWhenAbsent = missingWhenAbsent,
AuthoringAllowed = status is "implemented" or "partial" or "planned"
};
}
static string NormalizeToken(string value) => value.Trim().Replace(' ', '_').ToLowerInvariant();
}
sealed class Args
{
readonly Dictionary<string, string> _values;
Args(Dictionary<string, string> values)
{
_values = values;
}
public static Args Parse(string[] args)
{
var values = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
for (int i = 0; i < args.Length; i++)
{
var key = args[i];
if (!key.StartsWith("--", StringComparison.Ordinal))
throw new ArgumentException($"Unexpected argument: {key}");
if (i + 1 >= args.Length)
throw new ArgumentException($"Missing value for {key}");
values[key] = args[++i];
}
return new Args(values);
}
public string Required(string key)
{
if (!_values.TryGetValue(key, out var value) || string.IsNullOrWhiteSpace(value))
throw new ArgumentException($"{key} is required.");
return value;
}
public string? Optional(string key)
{
return _values.TryGetValue(key, out var value) ? value : null;
}
}
sealed class RuleTemplatePackage
{
public string Schema { get; set; } = "mechanical_rule_template_package_v1";
public string PackageId { get; set; } = "";
public TeachingSource Source { get; set; } = new();
public RuleExtractionContract ExtractionContract { get; set; } = new();
public List<BrepFactCapability> BrepFactCapabilities { get; set; } = [];
public List<RuleSemanticTemplate> SemanticRules { get; set; } = [];
public List<ImageStructureTemplate2D> ImageStructureTemplates { get; set; } = [];
}
sealed class BrepFactCapability
{
public string Fact { get; set; } = "";
public string SourceLayer { get; set; } = "";
public string ExtractorStatus { get; set; } = "";
public string Extractor { get; set; } = "";
public string RequiredPrimitive { get; set; } = "";
public string MissingWhenAbsent { get; set; } = "";
public bool AuthoringAllowed { get; set; }
public BrepFactCapability Clone()
{
return new BrepFactCapability
{
Fact = Fact,
SourceLayer = SourceLayer,
ExtractorStatus = ExtractorStatus,
Extractor = Extractor,
RequiredPrimitive = RequiredPrimitive,
MissingWhenAbsent = MissingWhenAbsent,
AuthoringAllowed = AuthoringAllowed
};
}
}
sealed class RuleExtractionContract
{
public string LlmResponsibility { get; set; } = "";
public string ProgramResponsibility { get; set; } = "";
public List<string> RequiredLlmOutputs { get; set; } = [];
public List<string> RequiredProgramEvidence { get; set; } = [];
public static RuleExtractionContract Default()
{
return new RuleExtractionContract
{
LlmResponsibility = "Extract rule semantics and image-side 2D structure templates from teaching image/text; do not judge product models.",
ProgramResponsibility = "Extract model B-rep evidence, generate model-side 2D section structures, match templates, and make final rule decisions.",
RequiredLlmOutputs =
[
"rule object and trigger condition",
"problem type and problem evidence",
"pass evidence types",
"image 2D structure templates",
"visual anchors such as m/h/t",
"ignored visual annotations such as hatches and scale"
],
RequiredProgramEvidence =
[
"components and inferred categories",
"faces, cylinders, planes, axes, and contact-like relations",
"scene candidates",
"section 2D structure instances",
"real dimensions and contact validation evidence"
]
};
}
}
sealed class TeachingSource
{
public string ImagePath { get; set; } = "";
public string? TextPath { get; set; }
public string ExtractionMode { get; set; } = "";
public List<string> Notes { get; set; } = [];
}
sealed class RuleSemanticTemplate
{
public string RuleId { get; set; } = "";
public string Title { get; set; } = "";
public RuleTriggerCondition TriggerCondition { get; set; } = new();
public ProblemTemplate Problem { get; set; } = new();
public List<PassEvidenceTemplate> PassEvidenceTypes { get; set; } = [];
public RuleDecisionLogic DecisionLogic { get; set; } = new();
}
sealed class RuleTriggerCondition
{
public string SceneType { get; set; } = "";
public string TargetObject { get; set; } = "";
public string HostObject { get; set; } = "";
public string Relation { get; set; } = "";
public List<string> RequiredEvidence { get; set; } = [];
}
sealed class ProblemTemplate
{
public string ProblemType { get; set; } = "";
public string Message { get; set; } = "";
public string SourceExample { get; set; } = "";
}
sealed class PassEvidenceTemplate
{
public string EvidenceType { get; set; } = "";
public string SourceExample { get; set; } = "";
public string Anchor { get; set; } = "";
public string Required2DTemplateId { get; set; } = "";
public List<string> RequiredModelEvidence { get; set; } = [];
public List<string> OptionalModelEvidence { get; set; } = [];
}
sealed class RuleDecisionLogic
{
public string IfTriggerMissing { get; set; } = "not_applicable";
public string IfTriggerUnknown { get; set; } = "needs_review";
public string IfTriggeredAndAnyPassEvidence { get; set; } = "pass";
public string IfTriggeredAndNoPassEvidence { get; set; } = "problem";
}
sealed class ImageStructureTemplate2D
{
public string TemplateId { get; set; } = "";
public string Role { get; set; } = "";
public string SourceExample { get; set; } = "";
public string Anchor { get; set; } = "";
public List<TemplateEntity> Entities { get; set; } = [];
public List<TemplateRelation> RequiredRelations { get; set; } = [];
public List<string> IgnoredVisualElements { get; set; } = [];
}
sealed class TemplateEntity
{
public string Id { get; set; } = "";
public string Kind { get; set; } = "";
public string SemanticRole { get; set; } = "";
}
sealed class TemplateRelation
{
public string Type { get; set; } = "";
public string A { get; set; } = "";
public string B { get; set; } = "";
}
static class JsonOptions
{
public static readonly JsonSerializerOptions Default = new()
{
PropertyNameCaseInsensitive = true,
WriteIndented = true,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals
};
}
@@ -0,0 +1,69 @@
# RuleTemplateGenerator
Converts teaching material into an executable rule package.
This tool is the future LLM-facing side of the diagnostic system. For now, the agent authors the first built-in rule package directly; later an LLM adapter should emit the same JSON contract.
## Responsibility
`RuleTemplateGenerator` handles only teaching material:
- input: teaching image and optional teaching text
- output: semantic rule templates plus image-side 2D structure templates
- it does not open SolidWorks models
- it does not decide whether a product model is correct
## Output Layers
The generated package has two required layers:
```text
teaching image/text
-> semantic rule template
-> image 2D structure template
```
The semantic rule template says when a rule applies, what problem is reported, and which pass evidence can prove the design is acceptable.
The image 2D structure template preserves drawable structural relations from the figure, such as contact, outside connectivity, gaps, ports, blocked paths, and anchors such as `m/h/t`. Hatch lines, table borders, line thickness, and printed scale are ignored.
## LLM Contract
Later, the LLM must output the same package structure. It is responsible for:
- extracting the rule object and trigger condition
- understanding which figure is problem evidence and which figures are pass evidence
- extracting visual anchors such as `m/h/t`
- producing image-side 2D structure templates
- listing the model evidence that the program must verify
The LLM must not decide whether a SolidWorks model has a fault. That belongs to `ModelDiagnosticVerifier`.
This tool is generic. The sleeve-removal rule is only the first sample; future rules such as bearing mounting, axial part limiting, keyway orientation, gear-on-shaft checks, and cover fastening should use the same package structure.
## Usage
Generate from a teaching image:
```powershell
dotnet run --project tools\model-diagnostics\RuleTemplateGenerator\RuleTemplateGenerator.csproj -c Release -- generate --image "D:\path\teaching.png" --out runtime\rule_templates\rule.json
```
Generate from a teaching image plus extracted text:
```powershell
dotnet run --project tools\model-diagnostics\RuleTemplateGenerator\RuleTemplateGenerator.csproj -c Release -- generate --image "D:\path\teaching.png" --text "D:\path\teaching.txt" --out runtime\rule_templates\rule.json
```
Create the current built-in sleeve-removal sample:
```powershell
dotnet run --project tools\model-diagnostics\RuleTemplateGenerator\RuleTemplateGenerator.csproj -c Release -- sample-sleeve runtime\rule_templates\tight_fit_sleeve_requires_disassembly_access.json
```
Validate a generated package:
```powershell
dotnet run --project tools\model-diagnostics\RuleTemplateGenerator\RuleTemplateGenerator.csproj -c Release -- validate runtime\rule_templates\tight_fit_sleeve_requires_disassembly_access.json
```
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"RuleTemplateGenerator/1.0.0": {
"runtime": {
"RuleTemplateGenerator.dll": {}
}
}
}
},
"libraries": {
"RuleTemplateGenerator/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
@@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"RuleTemplateGenerator/1.0.0": {
"runtime": {
"RuleTemplateGenerator.dll": {}
}
}
}
},
"libraries": {
"RuleTemplateGenerator/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
@@ -0,0 +1,13 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RuleTemplateGenerator")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1bdf41f4900b623dd9948b3fc71ac3bb71e8e8e4")]
[assembly: System.Reflection.AssemblyProductAttribute("RuleTemplateGenerator")]
[assembly: System.Reflection.AssemblyTitleAttribute("RuleTemplateGenerator")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
@@ -0,0 +1 @@
bcbb08f1184d66e8355c1a8b66c01a69914b51661602f2b483e54833adaf0b2e
@@ -0,0 +1,18 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetFrameworkIdentifier = .NETCoreApp
build_property.TargetFrameworkVersion = v8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property.EntryPointFilePath =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = RuleTemplateGenerator
build_property.ProjectDir = D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 8.0
build_property.EnableCodeStyleSeverity =
@@ -0,0 +1,8 @@
// <auto-generated/>
global using System;
global using System.Collections.Generic;
global using System.IO;
global using System.Linq;
global using System.Net.Http;
global using System.Threading;
global using System.Threading.Tasks;
@@ -0,0 +1 @@
4adceaa0e039f32f563b5b7b7aa7c63f1d009276bc47e1bf2e8041851f2e498f
@@ -0,0 +1,28 @@
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\bin\Debug\net8.0\RuleTemplateGenerator.exe
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\bin\Debug\net8.0\RuleTemplateGenerator.deps.json
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\bin\Debug\net8.0\RuleTemplateGenerator.runtimeconfig.json
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\bin\Debug\net8.0\RuleTemplateGenerator.dll
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\bin\Debug\net8.0\RuleTemplateGenerator.pdb
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.GeneratedMSBuildEditorConfig.editorconfig
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.AssemblyInfoInputs.cache
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.AssemblyInfo.cs
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.csproj.CoreCompileInputs.cache
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.dll
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Debug\net8.0\refint\RuleTemplateGenerator.dll
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.pdb
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.genruntimeconfig.cache
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Debug\net8.0\ref\RuleTemplateGenerator.dll
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\bin\Debug\net8.0\RuleTemplateGenerator.exe
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\bin\Debug\net8.0\RuleTemplateGenerator.deps.json
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\bin\Debug\net8.0\RuleTemplateGenerator.runtimeconfig.json
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\bin\Debug\net8.0\RuleTemplateGenerator.dll
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\bin\Debug\net8.0\RuleTemplateGenerator.pdb
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.GeneratedMSBuildEditorConfig.editorconfig
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.AssemblyInfoInputs.cache
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.AssemblyInfo.cs
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.csproj.CoreCompileInputs.cache
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.dll
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\obj\Debug\net8.0\refint\RuleTemplateGenerator.dll
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.pdb
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\obj\Debug\net8.0\RuleTemplateGenerator.genruntimeconfig.cache
D:\CSharpProjects\agent4\tools\model-diagnostics\RuleTemplateGenerator\obj\Debug\net8.0\ref\RuleTemplateGenerator.dll
@@ -0,0 +1 @@
362d5e96012fd83dc5d0fa81671ec3d8c79b91a9201ceea585cf8344fba8c8c6
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RuleTemplateGenerator")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1bdf41f4900b623dd9948b3fc71ac3bb71e8e8e4")]
[assembly: System.Reflection.AssemblyProductAttribute("RuleTemplateGenerator")]
[assembly: System.Reflection.AssemblyTitleAttribute("RuleTemplateGenerator")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
@@ -0,0 +1 @@
b112184a1a2b56eca563643332f466c1fc908638b116eaf373eac3d41b811d04
@@ -0,0 +1,18 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetFrameworkIdentifier = .NETCoreApp
build_property.TargetFrameworkVersion = v8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property.EntryPointFilePath =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = RuleTemplateGenerator
build_property.ProjectDir = D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 8.0
build_property.EnableCodeStyleSeverity =
@@ -0,0 +1,8 @@
// <auto-generated/>
global using System;
global using System.Collections.Generic;
global using System.IO;
global using System.Linq;
global using System.Net.Http;
global using System.Threading;
global using System.Threading.Tasks;
@@ -0,0 +1 @@
0b2315f20404785a970368a59b04a7ab194bee0fe18602508e6ea0f8a325ff39
@@ -0,0 +1,14 @@
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\bin\Release\net8.0\RuleTemplateGenerator.exe
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\bin\Release\net8.0\RuleTemplateGenerator.deps.json
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\bin\Release\net8.0\RuleTemplateGenerator.runtimeconfig.json
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\bin\Release\net8.0\RuleTemplateGenerator.dll
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\bin\Release\net8.0\RuleTemplateGenerator.pdb
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Release\net8.0\RuleTemplateGenerator.GeneratedMSBuildEditorConfig.editorconfig
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Release\net8.0\RuleTemplateGenerator.AssemblyInfoInputs.cache
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Release\net8.0\RuleTemplateGenerator.AssemblyInfo.cs
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Release\net8.0\RuleTemplateGenerator.csproj.CoreCompileInputs.cache
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Release\net8.0\RuleTemplateGenerator.dll
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Release\net8.0\refint\RuleTemplateGenerator.dll
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Release\net8.0\RuleTemplateGenerator.pdb
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Release\net8.0\RuleTemplateGenerator.genruntimeconfig.cache
D:\CSharpProjects\agent4\tools\RuleTemplateGenerator\obj\Release\net8.0\ref\RuleTemplateGenerator.dll
@@ -0,0 +1 @@
93e557dea09ea5401ee4e2bb6ebd693284d05302581d5dddb443bf1a510d27fe
@@ -0,0 +1,71 @@
{
"format": 1,
"restore": {
"D:\\CSharpProjects\\agent4\\tools\\model-diagnostics\\RuleTemplateGenerator\\RuleTemplateGenerator.csproj": {}
},
"projects": {
"D:\\CSharpProjects\\agent4\\tools\\model-diagnostics\\RuleTemplateGenerator\\RuleTemplateGenerator.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\CSharpProjects\\agent4\\tools\\model-diagnostics\\RuleTemplateGenerator\\RuleTemplateGenerator.csproj",
"projectName": "RuleTemplateGenerator",
"projectPath": "D:\\CSharpProjects\\agent4\\tools\\model-diagnostics\\RuleTemplateGenerator\\RuleTemplateGenerator.csproj",
"packagesPath": "C:\\Users\\86182\\.nuget\\packages\\",
"outputPath": "D:\\CSharpProjects\\agent4\\tools\\model-diagnostics\\RuleTemplateGenerator\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\86182\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.300"
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.300/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\86182\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\86182\.nuget\packages\" />
</ItemGroup>
</Project>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
@@ -0,0 +1,76 @@
{
"version": 4,
"targets": {
"net8.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net8.0": []
},
"packageFolders": {
"C:\\Users\\86182\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\CSharpProjects\\agent4\\tools\\model-diagnostics\\RuleTemplateGenerator\\RuleTemplateGenerator.csproj",
"projectName": "RuleTemplateGenerator",
"projectPath": "D:\\CSharpProjects\\agent4\\tools\\model-diagnostics\\RuleTemplateGenerator\\RuleTemplateGenerator.csproj",
"packagesPath": "C:\\Users\\86182\\.nuget\\packages\\",
"outputPath": "D:\\CSharpProjects\\agent4\\tools\\model-diagnostics\\RuleTemplateGenerator\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\86182\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.300"
},
"frameworks": {
"net8.0": {
"framework": "net8.0",
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.300/PortableRuntimeIdentifierGraph.json"
}
}
}
}
@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "ogYf4eSlpyY=",
"success": true,
"projectFilePath": "D:\\CSharpProjects\\agent4\\tools\\model-diagnostics\\RuleTemplateGenerator\\RuleTemplateGenerator.csproj",
"expectedPackageFiles": [],
"logs": []
}