feat: add candidate FreeCAD naming SDK and attachment oracles
Some checks failed
real-verification / chrome (push) Has been cancelled
real-verification / freecad-oracle (push) Has been cancelled
real-verification / wasm (push) Has been cancelled

Build and verify the candidate-only FreeCAD naming bridge and OCCT worker path, including three-stage StringHasher restoration. Add Datum, ShapeBinder, attachment-mode, and PartDesign structure oracles plus offline SDK build plans and CI boundary checks.
This commit is contained in:
2026-08-13 17:16:07 -04:00
parent 58c0807219
commit f97eae4153
79 changed files with 7936 additions and 77 deletions

View File

@@ -0,0 +1,41 @@
#ifndef SRC_APP_APPLICATION_H_
#define SRC_APP_APPLICATION_H_
#include <set>
#include <string>
namespace App {
class Document;
class ProbeSignal
{
public:
template<typename Callback>
void connect(Callback&&)
{}
};
class Application
{
public:
Document* getActiveDocument() const
{
return nullptr;
}
ProbeSignal signalStartSaveDocument;
ProbeSignal signalFinishSaveDocument;
ProbeSignal signalStartRestoreDocument;
ProbeSignal signalFinishRestoreDocument;
};
inline Application& GetApplication()
{
static Application application;
return application;
}
} // namespace App
#endif

View File

@@ -0,0 +1,19 @@
#ifndef SRC_APP_DOCUMENT_H_
#define SRC_APP_DOCUMENT_H_
#include <App/DocumentObject.h>
namespace App {
class Document
{
public:
DocumentObject* getObjectByID(long) const
{
return nullptr;
}
};
} // namespace App
#endif

View File

@@ -0,0 +1,31 @@
#ifndef SRC_APP_DOCUMENTOBJECT_H_
#define SRC_APP_DOCUMENTOBJECT_H_
#include <string>
namespace App {
class DocumentObject
{
public:
explicit DocumentObject(long id = 0)
: objectId(id)
{}
long getID() const
{
return objectId;
}
std::string getFullName() const
{
return "ProbeObject";
}
private:
long objectId;
};
} // namespace App
#endif

View File

@@ -1,27 +0,0 @@
#pragma once
#define APP_STRING_ID_H
#include <QByteArray>
namespace App
{
class StringIDRef
{
public:
void toBytes(QByteArray& bytes) const
{
bytes.clear();
}
bool operator<(const StringIDRef&) const
{
return false;
}
bool operator==(const StringIDRef&) const
{
return true;
}
};
} // namespace App

View File

@@ -1,3 +1,22 @@
#pragma once
#include <Base/Exception.h>
struct FreeCadNamingProbeLogInstance
{
bool isEnabled(int) const
{
return false;
}
};
inline FreeCadNamingProbeLogInstance freecad_naming_probe_log_instance;
#define FC_LOGLEVEL_LOG 3
#define FC_LOGLEVEL_TRACE 4
#define FC_LOG_INSTANCE freecad_naming_probe_log_instance
#define FC_LOG_LEVEL_INIT(...)
#define FC_WARN(message) ((void)0)
#define FC_ERR(message) ((void)0)
#define FC_LOG(message) ((void)0)
#define FC_TRACE(message) ((void)0)

View File

@@ -0,0 +1,35 @@
#pragma once
#include <sstream>
#include <stdexcept>
namespace Base {
class Exception : public std::runtime_error
{
public:
using std::runtime_error::runtime_error;
void reportException() const {}
};
class RuntimeError : public Exception
{
public:
using Exception::Exception;
};
class ValueError : public Exception
{
public:
using Exception::Exception;
};
} // namespace Base
#define FC_THROWM(type, message) \
do { \
std::ostringstream freecad_naming_probe_exception_stream; \
freecad_naming_probe_exception_stream << message; \
throw type(freecad_naming_probe_exception_stream.str()); \
} while (false)

View File

@@ -0,0 +1,38 @@
#pragma once
#include <CXX/Objects.hxx>
namespace Base {
class Reader;
class Writer;
class XMLReader;
class BaseClass
{
public:
virtual ~BaseClass() = default;
virtual PyObject* getPyObject()
{
return nullptr;
}
};
class Persistence : public BaseClass
{
public:
~Persistence() override = default;
virtual unsigned int getMemSize() const = 0;
virtual void Save(Writer&) const = 0;
virtual void Restore(XMLReader&) = 0;
virtual void SaveDocFile(Writer&) const = 0;
virtual void RestoreDocFile(Reader&) = 0;
};
} // namespace Base
#define TYPESYSTEM_HEADER()
#define TYPESYSTEM_HEADER_WITH_OVERRIDE()
#define TYPESYSTEM_SOURCE(...)
#define TYPESYSTEM_SOURCE_ABSTRACT(...)

View File

@@ -0,0 +1,3 @@
#pragma once
#include <CXX/Objects.hxx>

View File

@@ -0,0 +1,45 @@
#pragma once
#include <istream>
#include <sstream>
namespace Base {
class Reader : public std::istream
{
public:
Reader()
: std::istream(nullptr)
{}
};
class XMLReader
{
public:
template<typename T>
T getAttribute(const char*) const
{
return T {};
}
bool hasAttribute(const char*) const
{
return false;
}
void readElement(const char*) {}
void readEndElement(const char*) {}
void addFile(const char*, void*) {}
std::istream& beginCharStream()
{
return stream;
}
int FileVersion = 1;
private:
std::istringstream stream;
};
} // namespace Base

View File

@@ -0,0 +1,43 @@
#pragma once
#include <istream>
#include <ostream>
#include <string>
namespace Base {
class TextOutputStream
{
public:
explicit TextOutputStream(std::ostream& stream)
: output(stream)
{}
TextOutputStream& operator<<(const char* value)
{
output << value;
return *this;
}
private:
std::ostream& output;
};
class TextInputStream
{
public:
explicit TextInputStream(std::istream& stream)
: input(stream)
{}
TextInputStream& operator>>(std::string& value)
{
input >> value;
return *this;
}
private:
std::istream& input;
};
} // namespace Base

View File

@@ -0,0 +1,40 @@
#pragma once
#include <ostream>
#include <sstream>
namespace Base {
class Writer
{
public:
std::ostream& Stream()
{
return stream;
}
const char* ind() const
{
return "";
}
const char* addFile(const char* name, const void*)
{
return name;
}
std::ostream& beginCharStream()
{
return stream;
}
std::ostream& endCharStream()
{
return stream;
}
private:
std::ostringstream stream;
};
} // namespace Base

View File

@@ -0,0 +1,9 @@
#pragma once
struct _object {};
using PyObject = _object;
inline _object freecad_naming_probe_py_none;
#define Py_None (&freecad_naming_probe_py_none)
#define Py_INCREF(object) ((void)(object))

View File

@@ -0,0 +1,11 @@
#pragma once
#include <map>
#ifndef AppExport
#define AppExport
#endif
#ifndef BaseExport
#define BaseExport
#endif

View File

@@ -0,0 +1,5 @@
#pragma once
#include <App/DocumentObject.h>
#include <App/Document.h>
#include <App/Application.h>

View File

@@ -0,0 +1,15 @@
#pragma once
#include <CXX/Objects.hxx>
namespace App {
class StringHasher;
class StringHasherPy : public _object
{
public:
explicit StringHasherPy(StringHasher*) {}
};
} // namespace App

View File

@@ -0,0 +1,17 @@
#pragma once
#include <CXX/Objects.hxx>
namespace App {
class StringID;
class StringIDPy : public _object
{
public:
explicit StringIDPy(StringID*) {}
int _index = 0;
};
} // namespace App